1
2
3
4 package types
5
6 import (
7 bytes "bytes"
8 fmt "fmt"
9 proto "github.com/gogo/protobuf/proto"
10 io "io"
11 math "math"
12 math_bits "math/bits"
13 reflect "reflect"
14 strings "strings"
15 )
16
17
18 var _ = proto.Marshal
19 var _ = fmt.Errorf
20 var _ = math.Inf
21
22
23
24
25
26 const _ = proto.GoGoProtoPackageIsVersion3
27
28
29
30
31
32
33
34
35
36
37 type Api struct {
38
39
40 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
41
42 Methods []*Method `protobuf:"bytes,2,rep,name=methods,proto3" json:"methods,omitempty"`
43
44 Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"`
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66 Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
67
68
69 SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"`
70
71 Mixins []*Mixin `protobuf:"bytes,6,rep,name=mixins,proto3" json:"mixins,omitempty"`
72
73 Syntax Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
74 XXX_NoUnkeyedLiteral struct{} `json:"-"`
75 XXX_unrecognized []byte `json:"-"`
76 XXX_sizecache int32 `json:"-"`
77 }
78
79 func (m *Api) Reset() { *m = Api{} }
80 func (*Api) ProtoMessage() {}
81 func (*Api) Descriptor() ([]byte, []int) {
82 return fileDescriptor_a2ec32096296c143, []int{0}
83 }
84 func (m *Api) XXX_Unmarshal(b []byte) error {
85 return m.Unmarshal(b)
86 }
87 func (m *Api) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
88 if deterministic {
89 return xxx_messageInfo_Api.Marshal(b, m, deterministic)
90 } else {
91 b = b[:cap(b)]
92 n, err := m.MarshalToSizedBuffer(b)
93 if err != nil {
94 return nil, err
95 }
96 return b[:n], nil
97 }
98 }
99 func (m *Api) XXX_Merge(src proto.Message) {
100 xxx_messageInfo_Api.Merge(m, src)
101 }
102 func (m *Api) XXX_Size() int {
103 return m.Size()
104 }
105 func (m *Api) XXX_DiscardUnknown() {
106 xxx_messageInfo_Api.DiscardUnknown(m)
107 }
108
109 var xxx_messageInfo_Api proto.InternalMessageInfo
110
111 func (m *Api) GetName() string {
112 if m != nil {
113 return m.Name
114 }
115 return ""
116 }
117
118 func (m *Api) GetMethods() []*Method {
119 if m != nil {
120 return m.Methods
121 }
122 return nil
123 }
124
125 func (m *Api) GetOptions() []*Option {
126 if m != nil {
127 return m.Options
128 }
129 return nil
130 }
131
132 func (m *Api) GetVersion() string {
133 if m != nil {
134 return m.Version
135 }
136 return ""
137 }
138
139 func (m *Api) GetSourceContext() *SourceContext {
140 if m != nil {
141 return m.SourceContext
142 }
143 return nil
144 }
145
146 func (m *Api) GetMixins() []*Mixin {
147 if m != nil {
148 return m.Mixins
149 }
150 return nil
151 }
152
153 func (m *Api) GetSyntax() Syntax {
154 if m != nil {
155 return m.Syntax
156 }
157 return Syntax_SYNTAX_PROTO2
158 }
159
160 func (*Api) XXX_MessageName() string {
161 return "google.protobuf.Api"
162 }
163
164
165 type Method struct {
166
167 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
168
169 RequestTypeUrl string `protobuf:"bytes,2,opt,name=request_type_url,json=requestTypeUrl,proto3" json:"request_type_url,omitempty"`
170
171 RequestStreaming bool `protobuf:"varint,3,opt,name=request_streaming,json=requestStreaming,proto3" json:"request_streaming,omitempty"`
172
173 ResponseTypeUrl string `protobuf:"bytes,4,opt,name=response_type_url,json=responseTypeUrl,proto3" json:"response_type_url,omitempty"`
174
175 ResponseStreaming bool `protobuf:"varint,5,opt,name=response_streaming,json=responseStreaming,proto3" json:"response_streaming,omitempty"`
176
177 Options []*Option `protobuf:"bytes,6,rep,name=options,proto3" json:"options,omitempty"`
178
179 Syntax Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
180 XXX_NoUnkeyedLiteral struct{} `json:"-"`
181 XXX_unrecognized []byte `json:"-"`
182 XXX_sizecache int32 `json:"-"`
183 }
184
185 func (m *Method) Reset() { *m = Method{} }
186 func (*Method) ProtoMessage() {}
187 func (*Method) Descriptor() ([]byte, []int) {
188 return fileDescriptor_a2ec32096296c143, []int{1}
189 }
190 func (m *Method) XXX_Unmarshal(b []byte) error {
191 return m.Unmarshal(b)
192 }
193 func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
194 if deterministic {
195 return xxx_messageInfo_Method.Marshal(b, m, deterministic)
196 } else {
197 b = b[:cap(b)]
198 n, err := m.MarshalToSizedBuffer(b)
199 if err != nil {
200 return nil, err
201 }
202 return b[:n], nil
203 }
204 }
205 func (m *Method) XXX_Merge(src proto.Message) {
206 xxx_messageInfo_Method.Merge(m, src)
207 }
208 func (m *Method) XXX_Size() int {
209 return m.Size()
210 }
211 func (m *Method) XXX_DiscardUnknown() {
212 xxx_messageInfo_Method.DiscardUnknown(m)
213 }
214
215 var xxx_messageInfo_Method proto.InternalMessageInfo
216
217 func (m *Method) GetName() string {
218 if m != nil {
219 return m.Name
220 }
221 return ""
222 }
223
224 func (m *Method) GetRequestTypeUrl() string {
225 if m != nil {
226 return m.RequestTypeUrl
227 }
228 return ""
229 }
230
231 func (m *Method) GetRequestStreaming() bool {
232 if m != nil {
233 return m.RequestStreaming
234 }
235 return false
236 }
237
238 func (m *Method) GetResponseTypeUrl() string {
239 if m != nil {
240 return m.ResponseTypeUrl
241 }
242 return ""
243 }
244
245 func (m *Method) GetResponseStreaming() bool {
246 if m != nil {
247 return m.ResponseStreaming
248 }
249 return false
250 }
251
252 func (m *Method) GetOptions() []*Option {
253 if m != nil {
254 return m.Options
255 }
256 return nil
257 }
258
259 func (m *Method) GetSyntax() Syntax {
260 if m != nil {
261 return m.Syntax
262 }
263 return Syntax_SYNTAX_PROTO2
264 }
265
266 func (*Method) XXX_MessageName() string {
267 return "google.protobuf.Method"
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 type Mixin struct {
349
350 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
351
352
353 Root string `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"`
354 XXX_NoUnkeyedLiteral struct{} `json:"-"`
355 XXX_unrecognized []byte `json:"-"`
356 XXX_sizecache int32 `json:"-"`
357 }
358
359 func (m *Mixin) Reset() { *m = Mixin{} }
360 func (*Mixin) ProtoMessage() {}
361 func (*Mixin) Descriptor() ([]byte, []int) {
362 return fileDescriptor_a2ec32096296c143, []int{2}
363 }
364 func (m *Mixin) XXX_Unmarshal(b []byte) error {
365 return m.Unmarshal(b)
366 }
367 func (m *Mixin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
368 if deterministic {
369 return xxx_messageInfo_Mixin.Marshal(b, m, deterministic)
370 } else {
371 b = b[:cap(b)]
372 n, err := m.MarshalToSizedBuffer(b)
373 if err != nil {
374 return nil, err
375 }
376 return b[:n], nil
377 }
378 }
379 func (m *Mixin) XXX_Merge(src proto.Message) {
380 xxx_messageInfo_Mixin.Merge(m, src)
381 }
382 func (m *Mixin) XXX_Size() int {
383 return m.Size()
384 }
385 func (m *Mixin) XXX_DiscardUnknown() {
386 xxx_messageInfo_Mixin.DiscardUnknown(m)
387 }
388
389 var xxx_messageInfo_Mixin proto.InternalMessageInfo
390
391 func (m *Mixin) GetName() string {
392 if m != nil {
393 return m.Name
394 }
395 return ""
396 }
397
398 func (m *Mixin) GetRoot() string {
399 if m != nil {
400 return m.Root
401 }
402 return ""
403 }
404
405 func (*Mixin) XXX_MessageName() string {
406 return "google.protobuf.Mixin"
407 }
408 func init() {
409 proto.RegisterType((*Api)(nil), "google.protobuf.Api")
410 proto.RegisterType((*Method)(nil), "google.protobuf.Method")
411 proto.RegisterType((*Mixin)(nil), "google.protobuf.Mixin")
412 }
413
414 func init() { proto.RegisterFile("google/protobuf/api.proto", fileDescriptor_a2ec32096296c143) }
415
416 var fileDescriptor_a2ec32096296c143 = []byte{
417
418 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x31, 0x6f, 0x13, 0x31,
419 0x14, 0xc7, 0xeb, 0xbb, 0xe4, 0x52, 0x5c, 0x91, 0x82, 0x91, 0xc0, 0x64, 0xb0, 0x4e, 0x15, 0xc3,
420 0x09, 0xc4, 0x45, 0x94, 0x4f, 0xd0, 0x20, 0xd4, 0x01, 0x21, 0xa2, 0x0b, 0x08, 0x89, 0x25, 0x4a,
421 0x83, 0x09, 0x96, 0xee, 0x6c, 0x63, 0x3b, 0x90, 0x4c, 0xf0, 0x59, 0x98, 0x10, 0x23, 0xdf, 0x80,
422 0xad, 0x23, 0x23, 0x23, 0xb9, 0x2e, 0x8c, 0x1d, 0x19, 0x91, 0x7d, 0xe7, 0xa6, 0x5c, 0x83, 0x04,
423 0x9b, 0xdf, 0xfb, 0xff, 0xfc, 0xf7, 0x7b, 0x7f, 0xc3, 0x9b, 0x33, 0x21, 0x66, 0x39, 0xed, 0x4b,
424 0x25, 0x8c, 0x38, 0x9a, 0xbf, 0xea, 0x4f, 0x24, 0x4b, 0x5d, 0x81, 0x76, 0x2b, 0x29, 0xf5, 0x52,
425 0xef, 0x56, 0x93, 0xd5, 0x62, 0xae, 0xa6, 0x74, 0x3c, 0x15, 0xdc, 0xd0, 0x85, 0xa9, 0xc0, 0x5e,
426 0xaf, 0x49, 0x99, 0xa5, 0xac, 0x4d, 0xf6, 0xbe, 0x06, 0x30, 0x3c, 0x90, 0x0c, 0x21, 0xd8, 0xe2,
427 0x93, 0x82, 0x62, 0x10, 0x83, 0xe4, 0x52, 0xe6, 0xce, 0xe8, 0x1e, 0xec, 0x14, 0xd4, 0xbc, 0x16,
428 0x2f, 0x35, 0x0e, 0xe2, 0x30, 0xd9, 0xd9, 0xbf, 0x91, 0x36, 0x06, 0x48, 0x1f, 0x3b, 0x3d, 0xf3,
429 0x9c, 0xbd, 0x22, 0xa4, 0x61, 0x82, 0x6b, 0x1c, 0xfe, 0xe5, 0xca, 0x13, 0xa7, 0x67, 0x9e, 0x43,
430 0x18, 0x76, 0xde, 0x52, 0xa5, 0x99, 0xe0, 0xb8, 0xe5, 0x1e, 0xf7, 0x25, 0x7a, 0x08, 0xbb, 0x7f,
431 0xee, 0x83, 0xdb, 0x31, 0x48, 0x76, 0xf6, 0xc9, 0x05, 0xcf, 0x91, 0xc3, 0x1e, 0x54, 0x54, 0x76,
432 0x59, 0x9f, 0x2f, 0x51, 0x0a, 0xa3, 0x82, 0x2d, 0x18, 0xd7, 0x38, 0x72, 0x23, 0x5d, 0xbf, 0xb8,
433 0x85, 0x95, 0xb3, 0x9a, 0x42, 0x7d, 0x18, 0xe9, 0x25, 0x37, 0x93, 0x05, 0xee, 0xc4, 0x20, 0xe9,
434 0x6e, 0x58, 0x61, 0xe4, 0xe4, 0xac, 0xc6, 0xf6, 0xbe, 0x04, 0x30, 0xaa, 0x82, 0xd8, 0x18, 0x63,
435 0x02, 0xaf, 0x28, 0xfa, 0x66, 0x4e, 0xb5, 0x19, 0xdb, 0xe0, 0xc7, 0x73, 0x95, 0xe3, 0xc0, 0xe9,
436 0xdd, 0xba, 0xff, 0x74, 0x29, 0xe9, 0x33, 0x95, 0xa3, 0x3b, 0xf0, 0xaa, 0x27, 0xb5, 0x51, 0x74,
437 0x52, 0x30, 0x3e, 0xc3, 0x61, 0x0c, 0x92, 0xed, 0xcc, 0x5b, 0x8c, 0x7c, 0x1f, 0xdd, 0xb6, 0xb0,
438 0x96, 0x82, 0x6b, 0xba, 0xf6, 0xad, 0x12, 0xdc, 0xf5, 0x82, 0x37, 0xbe, 0x0b, 0xd1, 0x19, 0xbb,
439 0x76, 0x6e, 0x3b, 0xe7, 0x33, 0x97, 0xb5, 0xf5, 0xb9, 0x5f, 0x8c, 0xfe, 0xf1, 0x17, 0xff, 0x3b,
440 0xb4, 0x3e, 0x6c, 0xbb, 0xd8, 0x37, 0x46, 0x86, 0x60, 0x4b, 0x09, 0x61, 0xea, 0x98, 0xdc, 0x79,
441 0xf0, 0xfe, 0xfb, 0x8a, 0x6c, 0x9d, 0xae, 0x08, 0xf8, 0xb5, 0x22, 0xe0, 0x43, 0x49, 0xc0, 0xa7,
442 0x92, 0x80, 0xe3, 0x92, 0x80, 0x6f, 0x25, 0x01, 0x3f, 0x4a, 0x02, 0x7e, 0x96, 0x64, 0xeb, 0xd4,
443 0xf6, 0x4f, 0x08, 0x38, 0x3e, 0x21, 0x00, 0x5e, 0x9b, 0x8a, 0xa2, 0x39, 0xc6, 0x60, 0xfb, 0x40,
444 0xb2, 0xa1, 0x2d, 0x86, 0xe0, 0x45, 0xdb, 0xe6, 0xa6, 0x3f, 0x06, 0xe1, 0xe1, 0x70, 0xf0, 0x39,
445 0x20, 0x87, 0x15, 0x3a, 0xf4, 0x13, 0x3f, 0xa7, 0x79, 0xfe, 0x88, 0x8b, 0x77, 0xdc, 0xc6, 0xa8,
446 0x8f, 0x22, 0xe7, 0x71, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x64, 0x40, 0x40, 0xa1,
447 0x03, 0x00, 0x00,
448 }
449
450 func (this *Api) Compare(that interface{}) int {
451 if that == nil {
452 if this == nil {
453 return 0
454 }
455 return 1
456 }
457
458 that1, ok := that.(*Api)
459 if !ok {
460 that2, ok := that.(Api)
461 if ok {
462 that1 = &that2
463 } else {
464 return 1
465 }
466 }
467 if that1 == nil {
468 if this == nil {
469 return 0
470 }
471 return 1
472 } else if this == nil {
473 return -1
474 }
475 if this.Name != that1.Name {
476 if this.Name < that1.Name {
477 return -1
478 }
479 return 1
480 }
481 if len(this.Methods) != len(that1.Methods) {
482 if len(this.Methods) < len(that1.Methods) {
483 return -1
484 }
485 return 1
486 }
487 for i := range this.Methods {
488 if c := this.Methods[i].Compare(that1.Methods[i]); c != 0 {
489 return c
490 }
491 }
492 if len(this.Options) != len(that1.Options) {
493 if len(this.Options) < len(that1.Options) {
494 return -1
495 }
496 return 1
497 }
498 for i := range this.Options {
499 if c := this.Options[i].Compare(that1.Options[i]); c != 0 {
500 return c
501 }
502 }
503 if this.Version != that1.Version {
504 if this.Version < that1.Version {
505 return -1
506 }
507 return 1
508 }
509 if c := this.SourceContext.Compare(that1.SourceContext); c != 0 {
510 return c
511 }
512 if len(this.Mixins) != len(that1.Mixins) {
513 if len(this.Mixins) < len(that1.Mixins) {
514 return -1
515 }
516 return 1
517 }
518 for i := range this.Mixins {
519 if c := this.Mixins[i].Compare(that1.Mixins[i]); c != 0 {
520 return c
521 }
522 }
523 if this.Syntax != that1.Syntax {
524 if this.Syntax < that1.Syntax {
525 return -1
526 }
527 return 1
528 }
529 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
530 return c
531 }
532 return 0
533 }
534 func (this *Method) Compare(that interface{}) int {
535 if that == nil {
536 if this == nil {
537 return 0
538 }
539 return 1
540 }
541
542 that1, ok := that.(*Method)
543 if !ok {
544 that2, ok := that.(Method)
545 if ok {
546 that1 = &that2
547 } else {
548 return 1
549 }
550 }
551 if that1 == nil {
552 if this == nil {
553 return 0
554 }
555 return 1
556 } else if this == nil {
557 return -1
558 }
559 if this.Name != that1.Name {
560 if this.Name < that1.Name {
561 return -1
562 }
563 return 1
564 }
565 if this.RequestTypeUrl != that1.RequestTypeUrl {
566 if this.RequestTypeUrl < that1.RequestTypeUrl {
567 return -1
568 }
569 return 1
570 }
571 if this.RequestStreaming != that1.RequestStreaming {
572 if !this.RequestStreaming {
573 return -1
574 }
575 return 1
576 }
577 if this.ResponseTypeUrl != that1.ResponseTypeUrl {
578 if this.ResponseTypeUrl < that1.ResponseTypeUrl {
579 return -1
580 }
581 return 1
582 }
583 if this.ResponseStreaming != that1.ResponseStreaming {
584 if !this.ResponseStreaming {
585 return -1
586 }
587 return 1
588 }
589 if len(this.Options) != len(that1.Options) {
590 if len(this.Options) < len(that1.Options) {
591 return -1
592 }
593 return 1
594 }
595 for i := range this.Options {
596 if c := this.Options[i].Compare(that1.Options[i]); c != 0 {
597 return c
598 }
599 }
600 if this.Syntax != that1.Syntax {
601 if this.Syntax < that1.Syntax {
602 return -1
603 }
604 return 1
605 }
606 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
607 return c
608 }
609 return 0
610 }
611 func (this *Mixin) Compare(that interface{}) int {
612 if that == nil {
613 if this == nil {
614 return 0
615 }
616 return 1
617 }
618
619 that1, ok := that.(*Mixin)
620 if !ok {
621 that2, ok := that.(Mixin)
622 if ok {
623 that1 = &that2
624 } else {
625 return 1
626 }
627 }
628 if that1 == nil {
629 if this == nil {
630 return 0
631 }
632 return 1
633 } else if this == nil {
634 return -1
635 }
636 if this.Name != that1.Name {
637 if this.Name < that1.Name {
638 return -1
639 }
640 return 1
641 }
642 if this.Root != that1.Root {
643 if this.Root < that1.Root {
644 return -1
645 }
646 return 1
647 }
648 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
649 return c
650 }
651 return 0
652 }
653 func (this *Api) Equal(that interface{}) bool {
654 if that == nil {
655 return this == nil
656 }
657
658 that1, ok := that.(*Api)
659 if !ok {
660 that2, ok := that.(Api)
661 if ok {
662 that1 = &that2
663 } else {
664 return false
665 }
666 }
667 if that1 == nil {
668 return this == nil
669 } else if this == nil {
670 return false
671 }
672 if this.Name != that1.Name {
673 return false
674 }
675 if len(this.Methods) != len(that1.Methods) {
676 return false
677 }
678 for i := range this.Methods {
679 if !this.Methods[i].Equal(that1.Methods[i]) {
680 return false
681 }
682 }
683 if len(this.Options) != len(that1.Options) {
684 return false
685 }
686 for i := range this.Options {
687 if !this.Options[i].Equal(that1.Options[i]) {
688 return false
689 }
690 }
691 if this.Version != that1.Version {
692 return false
693 }
694 if !this.SourceContext.Equal(that1.SourceContext) {
695 return false
696 }
697 if len(this.Mixins) != len(that1.Mixins) {
698 return false
699 }
700 for i := range this.Mixins {
701 if !this.Mixins[i].Equal(that1.Mixins[i]) {
702 return false
703 }
704 }
705 if this.Syntax != that1.Syntax {
706 return false
707 }
708 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
709 return false
710 }
711 return true
712 }
713 func (this *Method) Equal(that interface{}) bool {
714 if that == nil {
715 return this == nil
716 }
717
718 that1, ok := that.(*Method)
719 if !ok {
720 that2, ok := that.(Method)
721 if ok {
722 that1 = &that2
723 } else {
724 return false
725 }
726 }
727 if that1 == nil {
728 return this == nil
729 } else if this == nil {
730 return false
731 }
732 if this.Name != that1.Name {
733 return false
734 }
735 if this.RequestTypeUrl != that1.RequestTypeUrl {
736 return false
737 }
738 if this.RequestStreaming != that1.RequestStreaming {
739 return false
740 }
741 if this.ResponseTypeUrl != that1.ResponseTypeUrl {
742 return false
743 }
744 if this.ResponseStreaming != that1.ResponseStreaming {
745 return false
746 }
747 if len(this.Options) != len(that1.Options) {
748 return false
749 }
750 for i := range this.Options {
751 if !this.Options[i].Equal(that1.Options[i]) {
752 return false
753 }
754 }
755 if this.Syntax != that1.Syntax {
756 return false
757 }
758 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
759 return false
760 }
761 return true
762 }
763 func (this *Mixin) Equal(that interface{}) bool {
764 if that == nil {
765 return this == nil
766 }
767
768 that1, ok := that.(*Mixin)
769 if !ok {
770 that2, ok := that.(Mixin)
771 if ok {
772 that1 = &that2
773 } else {
774 return false
775 }
776 }
777 if that1 == nil {
778 return this == nil
779 } else if this == nil {
780 return false
781 }
782 if this.Name != that1.Name {
783 return false
784 }
785 if this.Root != that1.Root {
786 return false
787 }
788 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
789 return false
790 }
791 return true
792 }
793 func (this *Api) GoString() string {
794 if this == nil {
795 return "nil"
796 }
797 s := make([]string, 0, 11)
798 s = append(s, "&types.Api{")
799 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n")
800 if this.Methods != nil {
801 s = append(s, "Methods: "+fmt.Sprintf("%#v", this.Methods)+",\n")
802 }
803 if this.Options != nil {
804 s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
805 }
806 s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n")
807 if this.SourceContext != nil {
808 s = append(s, "SourceContext: "+fmt.Sprintf("%#v", this.SourceContext)+",\n")
809 }
810 if this.Mixins != nil {
811 s = append(s, "Mixins: "+fmt.Sprintf("%#v", this.Mixins)+",\n")
812 }
813 s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n")
814 if this.XXX_unrecognized != nil {
815 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
816 }
817 s = append(s, "}")
818 return strings.Join(s, "")
819 }
820 func (this *Method) GoString() string {
821 if this == nil {
822 return "nil"
823 }
824 s := make([]string, 0, 11)
825 s = append(s, "&types.Method{")
826 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n")
827 s = append(s, "RequestTypeUrl: "+fmt.Sprintf("%#v", this.RequestTypeUrl)+",\n")
828 s = append(s, "RequestStreaming: "+fmt.Sprintf("%#v", this.RequestStreaming)+",\n")
829 s = append(s, "ResponseTypeUrl: "+fmt.Sprintf("%#v", this.ResponseTypeUrl)+",\n")
830 s = append(s, "ResponseStreaming: "+fmt.Sprintf("%#v", this.ResponseStreaming)+",\n")
831 if this.Options != nil {
832 s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n")
833 }
834 s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n")
835 if this.XXX_unrecognized != nil {
836 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
837 }
838 s = append(s, "}")
839 return strings.Join(s, "")
840 }
841 func (this *Mixin) GoString() string {
842 if this == nil {
843 return "nil"
844 }
845 s := make([]string, 0, 6)
846 s = append(s, "&types.Mixin{")
847 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n")
848 s = append(s, "Root: "+fmt.Sprintf("%#v", this.Root)+",\n")
849 if this.XXX_unrecognized != nil {
850 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
851 }
852 s = append(s, "}")
853 return strings.Join(s, "")
854 }
855 func valueToGoStringApi(v interface{}, typ string) string {
856 rv := reflect.ValueOf(v)
857 if rv.IsNil() {
858 return "nil"
859 }
860 pv := reflect.Indirect(rv).Interface()
861 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
862 }
863 func (m *Api) Marshal() (dAtA []byte, err error) {
864 size := m.Size()
865 dAtA = make([]byte, size)
866 n, err := m.MarshalToSizedBuffer(dAtA[:size])
867 if err != nil {
868 return nil, err
869 }
870 return dAtA[:n], nil
871 }
872
873 func (m *Api) MarshalTo(dAtA []byte) (int, error) {
874 size := m.Size()
875 return m.MarshalToSizedBuffer(dAtA[:size])
876 }
877
878 func (m *Api) MarshalToSizedBuffer(dAtA []byte) (int, error) {
879 i := len(dAtA)
880 _ = i
881 var l int
882 _ = l
883 if m.XXX_unrecognized != nil {
884 i -= len(m.XXX_unrecognized)
885 copy(dAtA[i:], m.XXX_unrecognized)
886 }
887 if m.Syntax != 0 {
888 i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
889 i--
890 dAtA[i] = 0x38
891 }
892 if len(m.Mixins) > 0 {
893 for iNdEx := len(m.Mixins) - 1; iNdEx >= 0; iNdEx-- {
894 {
895 size, err := m.Mixins[iNdEx].MarshalToSizedBuffer(dAtA[:i])
896 if err != nil {
897 return 0, err
898 }
899 i -= size
900 i = encodeVarintApi(dAtA, i, uint64(size))
901 }
902 i--
903 dAtA[i] = 0x32
904 }
905 }
906 if m.SourceContext != nil {
907 {
908 size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i])
909 if err != nil {
910 return 0, err
911 }
912 i -= size
913 i = encodeVarintApi(dAtA, i, uint64(size))
914 }
915 i--
916 dAtA[i] = 0x2a
917 }
918 if len(m.Version) > 0 {
919 i -= len(m.Version)
920 copy(dAtA[i:], m.Version)
921 i = encodeVarintApi(dAtA, i, uint64(len(m.Version)))
922 i--
923 dAtA[i] = 0x22
924 }
925 if len(m.Options) > 0 {
926 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
927 {
928 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
929 if err != nil {
930 return 0, err
931 }
932 i -= size
933 i = encodeVarintApi(dAtA, i, uint64(size))
934 }
935 i--
936 dAtA[i] = 0x1a
937 }
938 }
939 if len(m.Methods) > 0 {
940 for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- {
941 {
942 size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i])
943 if err != nil {
944 return 0, err
945 }
946 i -= size
947 i = encodeVarintApi(dAtA, i, uint64(size))
948 }
949 i--
950 dAtA[i] = 0x12
951 }
952 }
953 if len(m.Name) > 0 {
954 i -= len(m.Name)
955 copy(dAtA[i:], m.Name)
956 i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
957 i--
958 dAtA[i] = 0xa
959 }
960 return len(dAtA) - i, nil
961 }
962
963 func (m *Method) Marshal() (dAtA []byte, err error) {
964 size := m.Size()
965 dAtA = make([]byte, size)
966 n, err := m.MarshalToSizedBuffer(dAtA[:size])
967 if err != nil {
968 return nil, err
969 }
970 return dAtA[:n], nil
971 }
972
973 func (m *Method) MarshalTo(dAtA []byte) (int, error) {
974 size := m.Size()
975 return m.MarshalToSizedBuffer(dAtA[:size])
976 }
977
978 func (m *Method) MarshalToSizedBuffer(dAtA []byte) (int, error) {
979 i := len(dAtA)
980 _ = i
981 var l int
982 _ = l
983 if m.XXX_unrecognized != nil {
984 i -= len(m.XXX_unrecognized)
985 copy(dAtA[i:], m.XXX_unrecognized)
986 }
987 if m.Syntax != 0 {
988 i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
989 i--
990 dAtA[i] = 0x38
991 }
992 if len(m.Options) > 0 {
993 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
994 {
995 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
996 if err != nil {
997 return 0, err
998 }
999 i -= size
1000 i = encodeVarintApi(dAtA, i, uint64(size))
1001 }
1002 i--
1003 dAtA[i] = 0x32
1004 }
1005 }
1006 if m.ResponseStreaming {
1007 i--
1008 if m.ResponseStreaming {
1009 dAtA[i] = 1
1010 } else {
1011 dAtA[i] = 0
1012 }
1013 i--
1014 dAtA[i] = 0x28
1015 }
1016 if len(m.ResponseTypeUrl) > 0 {
1017 i -= len(m.ResponseTypeUrl)
1018 copy(dAtA[i:], m.ResponseTypeUrl)
1019 i = encodeVarintApi(dAtA, i, uint64(len(m.ResponseTypeUrl)))
1020 i--
1021 dAtA[i] = 0x22
1022 }
1023 if m.RequestStreaming {
1024 i--
1025 if m.RequestStreaming {
1026 dAtA[i] = 1
1027 } else {
1028 dAtA[i] = 0
1029 }
1030 i--
1031 dAtA[i] = 0x18
1032 }
1033 if len(m.RequestTypeUrl) > 0 {
1034 i -= len(m.RequestTypeUrl)
1035 copy(dAtA[i:], m.RequestTypeUrl)
1036 i = encodeVarintApi(dAtA, i, uint64(len(m.RequestTypeUrl)))
1037 i--
1038 dAtA[i] = 0x12
1039 }
1040 if len(m.Name) > 0 {
1041 i -= len(m.Name)
1042 copy(dAtA[i:], m.Name)
1043 i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
1044 i--
1045 dAtA[i] = 0xa
1046 }
1047 return len(dAtA) - i, nil
1048 }
1049
1050 func (m *Mixin) Marshal() (dAtA []byte, err error) {
1051 size := m.Size()
1052 dAtA = make([]byte, size)
1053 n, err := m.MarshalToSizedBuffer(dAtA[:size])
1054 if err != nil {
1055 return nil, err
1056 }
1057 return dAtA[:n], nil
1058 }
1059
1060 func (m *Mixin) MarshalTo(dAtA []byte) (int, error) {
1061 size := m.Size()
1062 return m.MarshalToSizedBuffer(dAtA[:size])
1063 }
1064
1065 func (m *Mixin) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1066 i := len(dAtA)
1067 _ = i
1068 var l int
1069 _ = l
1070 if m.XXX_unrecognized != nil {
1071 i -= len(m.XXX_unrecognized)
1072 copy(dAtA[i:], m.XXX_unrecognized)
1073 }
1074 if len(m.Root) > 0 {
1075 i -= len(m.Root)
1076 copy(dAtA[i:], m.Root)
1077 i = encodeVarintApi(dAtA, i, uint64(len(m.Root)))
1078 i--
1079 dAtA[i] = 0x12
1080 }
1081 if len(m.Name) > 0 {
1082 i -= len(m.Name)
1083 copy(dAtA[i:], m.Name)
1084 i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
1085 i--
1086 dAtA[i] = 0xa
1087 }
1088 return len(dAtA) - i, nil
1089 }
1090
1091 func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
1092 offset -= sovApi(v)
1093 base := offset
1094 for v >= 1<<7 {
1095 dAtA[offset] = uint8(v&0x7f | 0x80)
1096 v >>= 7
1097 offset++
1098 }
1099 dAtA[offset] = uint8(v)
1100 return base
1101 }
1102 func NewPopulatedApi(r randyApi, easy bool) *Api {
1103 this := &Api{}
1104 this.Name = string(randStringApi(r))
1105 if r.Intn(5) != 0 {
1106 v1 := r.Intn(5)
1107 this.Methods = make([]*Method, v1)
1108 for i := 0; i < v1; i++ {
1109 this.Methods[i] = NewPopulatedMethod(r, easy)
1110 }
1111 }
1112 if r.Intn(5) != 0 {
1113 v2 := r.Intn(5)
1114 this.Options = make([]*Option, v2)
1115 for i := 0; i < v2; i++ {
1116 this.Options[i] = NewPopulatedOption(r, easy)
1117 }
1118 }
1119 this.Version = string(randStringApi(r))
1120 if r.Intn(5) != 0 {
1121 this.SourceContext = NewPopulatedSourceContext(r, easy)
1122 }
1123 if r.Intn(5) != 0 {
1124 v3 := r.Intn(5)
1125 this.Mixins = make([]*Mixin, v3)
1126 for i := 0; i < v3; i++ {
1127 this.Mixins[i] = NewPopulatedMixin(r, easy)
1128 }
1129 }
1130 this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)])
1131 if !easy && r.Intn(10) != 0 {
1132 this.XXX_unrecognized = randUnrecognizedApi(r, 8)
1133 }
1134 return this
1135 }
1136
1137 func NewPopulatedMethod(r randyApi, easy bool) *Method {
1138 this := &Method{}
1139 this.Name = string(randStringApi(r))
1140 this.RequestTypeUrl = string(randStringApi(r))
1141 this.RequestStreaming = bool(bool(r.Intn(2) == 0))
1142 this.ResponseTypeUrl = string(randStringApi(r))
1143 this.ResponseStreaming = bool(bool(r.Intn(2) == 0))
1144 if r.Intn(5) != 0 {
1145 v4 := r.Intn(5)
1146 this.Options = make([]*Option, v4)
1147 for i := 0; i < v4; i++ {
1148 this.Options[i] = NewPopulatedOption(r, easy)
1149 }
1150 }
1151 this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)])
1152 if !easy && r.Intn(10) != 0 {
1153 this.XXX_unrecognized = randUnrecognizedApi(r, 8)
1154 }
1155 return this
1156 }
1157
1158 func NewPopulatedMixin(r randyApi, easy bool) *Mixin {
1159 this := &Mixin{}
1160 this.Name = string(randStringApi(r))
1161 this.Root = string(randStringApi(r))
1162 if !easy && r.Intn(10) != 0 {
1163 this.XXX_unrecognized = randUnrecognizedApi(r, 3)
1164 }
1165 return this
1166 }
1167
1168 type randyApi interface {
1169 Float32() float32
1170 Float64() float64
1171 Int63() int64
1172 Int31() int32
1173 Uint32() uint32
1174 Intn(n int) int
1175 }
1176
1177 func randUTF8RuneApi(r randyApi) rune {
1178 ru := r.Intn(62)
1179 if ru < 10 {
1180 return rune(ru + 48)
1181 } else if ru < 36 {
1182 return rune(ru + 55)
1183 }
1184 return rune(ru + 61)
1185 }
1186 func randStringApi(r randyApi) string {
1187 v5 := r.Intn(100)
1188 tmps := make([]rune, v5)
1189 for i := 0; i < v5; i++ {
1190 tmps[i] = randUTF8RuneApi(r)
1191 }
1192 return string(tmps)
1193 }
1194 func randUnrecognizedApi(r randyApi, maxFieldNumber int) (dAtA []byte) {
1195 l := r.Intn(5)
1196 for i := 0; i < l; i++ {
1197 wire := r.Intn(4)
1198 if wire == 3 {
1199 wire = 5
1200 }
1201 fieldNumber := maxFieldNumber + r.Intn(100)
1202 dAtA = randFieldApi(dAtA, r, fieldNumber, wire)
1203 }
1204 return dAtA
1205 }
1206 func randFieldApi(dAtA []byte, r randyApi, fieldNumber int, wire int) []byte {
1207 key := uint32(fieldNumber)<<3 | uint32(wire)
1208 switch wire {
1209 case 0:
1210 dAtA = encodeVarintPopulateApi(dAtA, uint64(key))
1211 v6 := r.Int63()
1212 if r.Intn(2) == 0 {
1213 v6 *= -1
1214 }
1215 dAtA = encodeVarintPopulateApi(dAtA, uint64(v6))
1216 case 1:
1217 dAtA = encodeVarintPopulateApi(dAtA, uint64(key))
1218 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
1219 case 2:
1220 dAtA = encodeVarintPopulateApi(dAtA, uint64(key))
1221 ll := r.Intn(100)
1222 dAtA = encodeVarintPopulateApi(dAtA, uint64(ll))
1223 for j := 0; j < ll; j++ {
1224 dAtA = append(dAtA, byte(r.Intn(256)))
1225 }
1226 default:
1227 dAtA = encodeVarintPopulateApi(dAtA, uint64(key))
1228 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
1229 }
1230 return dAtA
1231 }
1232 func encodeVarintPopulateApi(dAtA []byte, v uint64) []byte {
1233 for v >= 1<<7 {
1234 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
1235 v >>= 7
1236 }
1237 dAtA = append(dAtA, uint8(v))
1238 return dAtA
1239 }
1240 func (m *Api) Size() (n int) {
1241 if m == nil {
1242 return 0
1243 }
1244 var l int
1245 _ = l
1246 l = len(m.Name)
1247 if l > 0 {
1248 n += 1 + l + sovApi(uint64(l))
1249 }
1250 if len(m.Methods) > 0 {
1251 for _, e := range m.Methods {
1252 l = e.Size()
1253 n += 1 + l + sovApi(uint64(l))
1254 }
1255 }
1256 if len(m.Options) > 0 {
1257 for _, e := range m.Options {
1258 l = e.Size()
1259 n += 1 + l + sovApi(uint64(l))
1260 }
1261 }
1262 l = len(m.Version)
1263 if l > 0 {
1264 n += 1 + l + sovApi(uint64(l))
1265 }
1266 if m.SourceContext != nil {
1267 l = m.SourceContext.Size()
1268 n += 1 + l + sovApi(uint64(l))
1269 }
1270 if len(m.Mixins) > 0 {
1271 for _, e := range m.Mixins {
1272 l = e.Size()
1273 n += 1 + l + sovApi(uint64(l))
1274 }
1275 }
1276 if m.Syntax != 0 {
1277 n += 1 + sovApi(uint64(m.Syntax))
1278 }
1279 if m.XXX_unrecognized != nil {
1280 n += len(m.XXX_unrecognized)
1281 }
1282 return n
1283 }
1284
1285 func (m *Method) Size() (n int) {
1286 if m == nil {
1287 return 0
1288 }
1289 var l int
1290 _ = l
1291 l = len(m.Name)
1292 if l > 0 {
1293 n += 1 + l + sovApi(uint64(l))
1294 }
1295 l = len(m.RequestTypeUrl)
1296 if l > 0 {
1297 n += 1 + l + sovApi(uint64(l))
1298 }
1299 if m.RequestStreaming {
1300 n += 2
1301 }
1302 l = len(m.ResponseTypeUrl)
1303 if l > 0 {
1304 n += 1 + l + sovApi(uint64(l))
1305 }
1306 if m.ResponseStreaming {
1307 n += 2
1308 }
1309 if len(m.Options) > 0 {
1310 for _, e := range m.Options {
1311 l = e.Size()
1312 n += 1 + l + sovApi(uint64(l))
1313 }
1314 }
1315 if m.Syntax != 0 {
1316 n += 1 + sovApi(uint64(m.Syntax))
1317 }
1318 if m.XXX_unrecognized != nil {
1319 n += len(m.XXX_unrecognized)
1320 }
1321 return n
1322 }
1323
1324 func (m *Mixin) Size() (n int) {
1325 if m == nil {
1326 return 0
1327 }
1328 var l int
1329 _ = l
1330 l = len(m.Name)
1331 if l > 0 {
1332 n += 1 + l + sovApi(uint64(l))
1333 }
1334 l = len(m.Root)
1335 if l > 0 {
1336 n += 1 + l + sovApi(uint64(l))
1337 }
1338 if m.XXX_unrecognized != nil {
1339 n += len(m.XXX_unrecognized)
1340 }
1341 return n
1342 }
1343
1344 func sovApi(x uint64) (n int) {
1345 return (math_bits.Len64(x|1) + 6) / 7
1346 }
1347 func sozApi(x uint64) (n int) {
1348 return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
1349 }
1350 func (this *Api) String() string {
1351 if this == nil {
1352 return "nil"
1353 }
1354 repeatedStringForMethods := "[]*Method{"
1355 for _, f := range this.Methods {
1356 repeatedStringForMethods += strings.Replace(f.String(), "Method", "Method", 1) + ","
1357 }
1358 repeatedStringForMethods += "}"
1359 repeatedStringForOptions := "[]*Option{"
1360 for _, f := range this.Options {
1361 repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + ","
1362 }
1363 repeatedStringForOptions += "}"
1364 repeatedStringForMixins := "[]*Mixin{"
1365 for _, f := range this.Mixins {
1366 repeatedStringForMixins += strings.Replace(f.String(), "Mixin", "Mixin", 1) + ","
1367 }
1368 repeatedStringForMixins += "}"
1369 s := strings.Join([]string{`&Api{`,
1370 `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
1371 `Methods:` + repeatedStringForMethods + `,`,
1372 `Options:` + repeatedStringForOptions + `,`,
1373 `Version:` + fmt.Sprintf("%v", this.Version) + `,`,
1374 `SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
1375 `Mixins:` + repeatedStringForMixins + `,`,
1376 `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
1377 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
1378 `}`,
1379 }, "")
1380 return s
1381 }
1382 func (this *Method) String() string {
1383 if this == nil {
1384 return "nil"
1385 }
1386 repeatedStringForOptions := "[]*Option{"
1387 for _, f := range this.Options {
1388 repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + ","
1389 }
1390 repeatedStringForOptions += "}"
1391 s := strings.Join([]string{`&Method{`,
1392 `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
1393 `RequestTypeUrl:` + fmt.Sprintf("%v", this.RequestTypeUrl) + `,`,
1394 `RequestStreaming:` + fmt.Sprintf("%v", this.RequestStreaming) + `,`,
1395 `ResponseTypeUrl:` + fmt.Sprintf("%v", this.ResponseTypeUrl) + `,`,
1396 `ResponseStreaming:` + fmt.Sprintf("%v", this.ResponseStreaming) + `,`,
1397 `Options:` + repeatedStringForOptions + `,`,
1398 `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
1399 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
1400 `}`,
1401 }, "")
1402 return s
1403 }
1404 func (this *Mixin) String() string {
1405 if this == nil {
1406 return "nil"
1407 }
1408 s := strings.Join([]string{`&Mixin{`,
1409 `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
1410 `Root:` + fmt.Sprintf("%v", this.Root) + `,`,
1411 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
1412 `}`,
1413 }, "")
1414 return s
1415 }
1416 func valueToStringApi(v interface{}) string {
1417 rv := reflect.ValueOf(v)
1418 if rv.IsNil() {
1419 return "nil"
1420 }
1421 pv := reflect.Indirect(rv).Interface()
1422 return fmt.Sprintf("*%v", pv)
1423 }
1424 func (m *Api) Unmarshal(dAtA []byte) error {
1425 l := len(dAtA)
1426 iNdEx := 0
1427 for iNdEx < l {
1428 preIndex := iNdEx
1429 var wire uint64
1430 for shift := uint(0); ; shift += 7 {
1431 if shift >= 64 {
1432 return ErrIntOverflowApi
1433 }
1434 if iNdEx >= l {
1435 return io.ErrUnexpectedEOF
1436 }
1437 b := dAtA[iNdEx]
1438 iNdEx++
1439 wire |= uint64(b&0x7F) << shift
1440 if b < 0x80 {
1441 break
1442 }
1443 }
1444 fieldNum := int32(wire >> 3)
1445 wireType := int(wire & 0x7)
1446 if wireType == 4 {
1447 return fmt.Errorf("proto: Api: wiretype end group for non-group")
1448 }
1449 if fieldNum <= 0 {
1450 return fmt.Errorf("proto: Api: illegal tag %d (wire type %d)", fieldNum, wire)
1451 }
1452 switch fieldNum {
1453 case 1:
1454 if wireType != 2 {
1455 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
1456 }
1457 var stringLen uint64
1458 for shift := uint(0); ; shift += 7 {
1459 if shift >= 64 {
1460 return ErrIntOverflowApi
1461 }
1462 if iNdEx >= l {
1463 return io.ErrUnexpectedEOF
1464 }
1465 b := dAtA[iNdEx]
1466 iNdEx++
1467 stringLen |= uint64(b&0x7F) << shift
1468 if b < 0x80 {
1469 break
1470 }
1471 }
1472 intStringLen := int(stringLen)
1473 if intStringLen < 0 {
1474 return ErrInvalidLengthApi
1475 }
1476 postIndex := iNdEx + intStringLen
1477 if postIndex < 0 {
1478 return ErrInvalidLengthApi
1479 }
1480 if postIndex > l {
1481 return io.ErrUnexpectedEOF
1482 }
1483 m.Name = string(dAtA[iNdEx:postIndex])
1484 iNdEx = postIndex
1485 case 2:
1486 if wireType != 2 {
1487 return fmt.Errorf("proto: wrong wireType = %d for field Methods", wireType)
1488 }
1489 var msglen int
1490 for shift := uint(0); ; shift += 7 {
1491 if shift >= 64 {
1492 return ErrIntOverflowApi
1493 }
1494 if iNdEx >= l {
1495 return io.ErrUnexpectedEOF
1496 }
1497 b := dAtA[iNdEx]
1498 iNdEx++
1499 msglen |= int(b&0x7F) << shift
1500 if b < 0x80 {
1501 break
1502 }
1503 }
1504 if msglen < 0 {
1505 return ErrInvalidLengthApi
1506 }
1507 postIndex := iNdEx + msglen
1508 if postIndex < 0 {
1509 return ErrInvalidLengthApi
1510 }
1511 if postIndex > l {
1512 return io.ErrUnexpectedEOF
1513 }
1514 m.Methods = append(m.Methods, &Method{})
1515 if err := m.Methods[len(m.Methods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
1516 return err
1517 }
1518 iNdEx = postIndex
1519 case 3:
1520 if wireType != 2 {
1521 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
1522 }
1523 var msglen int
1524 for shift := uint(0); ; shift += 7 {
1525 if shift >= 64 {
1526 return ErrIntOverflowApi
1527 }
1528 if iNdEx >= l {
1529 return io.ErrUnexpectedEOF
1530 }
1531 b := dAtA[iNdEx]
1532 iNdEx++
1533 msglen |= int(b&0x7F) << shift
1534 if b < 0x80 {
1535 break
1536 }
1537 }
1538 if msglen < 0 {
1539 return ErrInvalidLengthApi
1540 }
1541 postIndex := iNdEx + msglen
1542 if postIndex < 0 {
1543 return ErrInvalidLengthApi
1544 }
1545 if postIndex > l {
1546 return io.ErrUnexpectedEOF
1547 }
1548 m.Options = append(m.Options, &Option{})
1549 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
1550 return err
1551 }
1552 iNdEx = postIndex
1553 case 4:
1554 if wireType != 2 {
1555 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
1556 }
1557 var stringLen uint64
1558 for shift := uint(0); ; shift += 7 {
1559 if shift >= 64 {
1560 return ErrIntOverflowApi
1561 }
1562 if iNdEx >= l {
1563 return io.ErrUnexpectedEOF
1564 }
1565 b := dAtA[iNdEx]
1566 iNdEx++
1567 stringLen |= uint64(b&0x7F) << shift
1568 if b < 0x80 {
1569 break
1570 }
1571 }
1572 intStringLen := int(stringLen)
1573 if intStringLen < 0 {
1574 return ErrInvalidLengthApi
1575 }
1576 postIndex := iNdEx + intStringLen
1577 if postIndex < 0 {
1578 return ErrInvalidLengthApi
1579 }
1580 if postIndex > l {
1581 return io.ErrUnexpectedEOF
1582 }
1583 m.Version = string(dAtA[iNdEx:postIndex])
1584 iNdEx = postIndex
1585 case 5:
1586 if wireType != 2 {
1587 return fmt.Errorf("proto: wrong wireType = %d for field SourceContext", wireType)
1588 }
1589 var msglen int
1590 for shift := uint(0); ; shift += 7 {
1591 if shift >= 64 {
1592 return ErrIntOverflowApi
1593 }
1594 if iNdEx >= l {
1595 return io.ErrUnexpectedEOF
1596 }
1597 b := dAtA[iNdEx]
1598 iNdEx++
1599 msglen |= int(b&0x7F) << shift
1600 if b < 0x80 {
1601 break
1602 }
1603 }
1604 if msglen < 0 {
1605 return ErrInvalidLengthApi
1606 }
1607 postIndex := iNdEx + msglen
1608 if postIndex < 0 {
1609 return ErrInvalidLengthApi
1610 }
1611 if postIndex > l {
1612 return io.ErrUnexpectedEOF
1613 }
1614 if m.SourceContext == nil {
1615 m.SourceContext = &SourceContext{}
1616 }
1617 if err := m.SourceContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
1618 return err
1619 }
1620 iNdEx = postIndex
1621 case 6:
1622 if wireType != 2 {
1623 return fmt.Errorf("proto: wrong wireType = %d for field Mixins", wireType)
1624 }
1625 var msglen int
1626 for shift := uint(0); ; shift += 7 {
1627 if shift >= 64 {
1628 return ErrIntOverflowApi
1629 }
1630 if iNdEx >= l {
1631 return io.ErrUnexpectedEOF
1632 }
1633 b := dAtA[iNdEx]
1634 iNdEx++
1635 msglen |= int(b&0x7F) << shift
1636 if b < 0x80 {
1637 break
1638 }
1639 }
1640 if msglen < 0 {
1641 return ErrInvalidLengthApi
1642 }
1643 postIndex := iNdEx + msglen
1644 if postIndex < 0 {
1645 return ErrInvalidLengthApi
1646 }
1647 if postIndex > l {
1648 return io.ErrUnexpectedEOF
1649 }
1650 m.Mixins = append(m.Mixins, &Mixin{})
1651 if err := m.Mixins[len(m.Mixins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
1652 return err
1653 }
1654 iNdEx = postIndex
1655 case 7:
1656 if wireType != 0 {
1657 return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType)
1658 }
1659 m.Syntax = 0
1660 for shift := uint(0); ; shift += 7 {
1661 if shift >= 64 {
1662 return ErrIntOverflowApi
1663 }
1664 if iNdEx >= l {
1665 return io.ErrUnexpectedEOF
1666 }
1667 b := dAtA[iNdEx]
1668 iNdEx++
1669 m.Syntax |= Syntax(b&0x7F) << shift
1670 if b < 0x80 {
1671 break
1672 }
1673 }
1674 default:
1675 iNdEx = preIndex
1676 skippy, err := skipApi(dAtA[iNdEx:])
1677 if err != nil {
1678 return err
1679 }
1680 if (skippy < 0) || (iNdEx+skippy) < 0 {
1681 return ErrInvalidLengthApi
1682 }
1683 if (iNdEx + skippy) > l {
1684 return io.ErrUnexpectedEOF
1685 }
1686 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
1687 iNdEx += skippy
1688 }
1689 }
1690
1691 if iNdEx > l {
1692 return io.ErrUnexpectedEOF
1693 }
1694 return nil
1695 }
1696 func (m *Method) Unmarshal(dAtA []byte) error {
1697 l := len(dAtA)
1698 iNdEx := 0
1699 for iNdEx < l {
1700 preIndex := iNdEx
1701 var wire uint64
1702 for shift := uint(0); ; shift += 7 {
1703 if shift >= 64 {
1704 return ErrIntOverflowApi
1705 }
1706 if iNdEx >= l {
1707 return io.ErrUnexpectedEOF
1708 }
1709 b := dAtA[iNdEx]
1710 iNdEx++
1711 wire |= uint64(b&0x7F) << shift
1712 if b < 0x80 {
1713 break
1714 }
1715 }
1716 fieldNum := int32(wire >> 3)
1717 wireType := int(wire & 0x7)
1718 if wireType == 4 {
1719 return fmt.Errorf("proto: Method: wiretype end group for non-group")
1720 }
1721 if fieldNum <= 0 {
1722 return fmt.Errorf("proto: Method: illegal tag %d (wire type %d)", fieldNum, wire)
1723 }
1724 switch fieldNum {
1725 case 1:
1726 if wireType != 2 {
1727 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
1728 }
1729 var stringLen uint64
1730 for shift := uint(0); ; shift += 7 {
1731 if shift >= 64 {
1732 return ErrIntOverflowApi
1733 }
1734 if iNdEx >= l {
1735 return io.ErrUnexpectedEOF
1736 }
1737 b := dAtA[iNdEx]
1738 iNdEx++
1739 stringLen |= uint64(b&0x7F) << shift
1740 if b < 0x80 {
1741 break
1742 }
1743 }
1744 intStringLen := int(stringLen)
1745 if intStringLen < 0 {
1746 return ErrInvalidLengthApi
1747 }
1748 postIndex := iNdEx + intStringLen
1749 if postIndex < 0 {
1750 return ErrInvalidLengthApi
1751 }
1752 if postIndex > l {
1753 return io.ErrUnexpectedEOF
1754 }
1755 m.Name = string(dAtA[iNdEx:postIndex])
1756 iNdEx = postIndex
1757 case 2:
1758 if wireType != 2 {
1759 return fmt.Errorf("proto: wrong wireType = %d for field RequestTypeUrl", wireType)
1760 }
1761 var stringLen uint64
1762 for shift := uint(0); ; shift += 7 {
1763 if shift >= 64 {
1764 return ErrIntOverflowApi
1765 }
1766 if iNdEx >= l {
1767 return io.ErrUnexpectedEOF
1768 }
1769 b := dAtA[iNdEx]
1770 iNdEx++
1771 stringLen |= uint64(b&0x7F) << shift
1772 if b < 0x80 {
1773 break
1774 }
1775 }
1776 intStringLen := int(stringLen)
1777 if intStringLen < 0 {
1778 return ErrInvalidLengthApi
1779 }
1780 postIndex := iNdEx + intStringLen
1781 if postIndex < 0 {
1782 return ErrInvalidLengthApi
1783 }
1784 if postIndex > l {
1785 return io.ErrUnexpectedEOF
1786 }
1787 m.RequestTypeUrl = string(dAtA[iNdEx:postIndex])
1788 iNdEx = postIndex
1789 case 3:
1790 if wireType != 0 {
1791 return fmt.Errorf("proto: wrong wireType = %d for field RequestStreaming", wireType)
1792 }
1793 var v int
1794 for shift := uint(0); ; shift += 7 {
1795 if shift >= 64 {
1796 return ErrIntOverflowApi
1797 }
1798 if iNdEx >= l {
1799 return io.ErrUnexpectedEOF
1800 }
1801 b := dAtA[iNdEx]
1802 iNdEx++
1803 v |= int(b&0x7F) << shift
1804 if b < 0x80 {
1805 break
1806 }
1807 }
1808 m.RequestStreaming = bool(v != 0)
1809 case 4:
1810 if wireType != 2 {
1811 return fmt.Errorf("proto: wrong wireType = %d for field ResponseTypeUrl", wireType)
1812 }
1813 var stringLen uint64
1814 for shift := uint(0); ; shift += 7 {
1815 if shift >= 64 {
1816 return ErrIntOverflowApi
1817 }
1818 if iNdEx >= l {
1819 return io.ErrUnexpectedEOF
1820 }
1821 b := dAtA[iNdEx]
1822 iNdEx++
1823 stringLen |= uint64(b&0x7F) << shift
1824 if b < 0x80 {
1825 break
1826 }
1827 }
1828 intStringLen := int(stringLen)
1829 if intStringLen < 0 {
1830 return ErrInvalidLengthApi
1831 }
1832 postIndex := iNdEx + intStringLen
1833 if postIndex < 0 {
1834 return ErrInvalidLengthApi
1835 }
1836 if postIndex > l {
1837 return io.ErrUnexpectedEOF
1838 }
1839 m.ResponseTypeUrl = string(dAtA[iNdEx:postIndex])
1840 iNdEx = postIndex
1841 case 5:
1842 if wireType != 0 {
1843 return fmt.Errorf("proto: wrong wireType = %d for field ResponseStreaming", wireType)
1844 }
1845 var v int
1846 for shift := uint(0); ; shift += 7 {
1847 if shift >= 64 {
1848 return ErrIntOverflowApi
1849 }
1850 if iNdEx >= l {
1851 return io.ErrUnexpectedEOF
1852 }
1853 b := dAtA[iNdEx]
1854 iNdEx++
1855 v |= int(b&0x7F) << shift
1856 if b < 0x80 {
1857 break
1858 }
1859 }
1860 m.ResponseStreaming = bool(v != 0)
1861 case 6:
1862 if wireType != 2 {
1863 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
1864 }
1865 var msglen int
1866 for shift := uint(0); ; shift += 7 {
1867 if shift >= 64 {
1868 return ErrIntOverflowApi
1869 }
1870 if iNdEx >= l {
1871 return io.ErrUnexpectedEOF
1872 }
1873 b := dAtA[iNdEx]
1874 iNdEx++
1875 msglen |= int(b&0x7F) << shift
1876 if b < 0x80 {
1877 break
1878 }
1879 }
1880 if msglen < 0 {
1881 return ErrInvalidLengthApi
1882 }
1883 postIndex := iNdEx + msglen
1884 if postIndex < 0 {
1885 return ErrInvalidLengthApi
1886 }
1887 if postIndex > l {
1888 return io.ErrUnexpectedEOF
1889 }
1890 m.Options = append(m.Options, &Option{})
1891 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
1892 return err
1893 }
1894 iNdEx = postIndex
1895 case 7:
1896 if wireType != 0 {
1897 return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType)
1898 }
1899 m.Syntax = 0
1900 for shift := uint(0); ; shift += 7 {
1901 if shift >= 64 {
1902 return ErrIntOverflowApi
1903 }
1904 if iNdEx >= l {
1905 return io.ErrUnexpectedEOF
1906 }
1907 b := dAtA[iNdEx]
1908 iNdEx++
1909 m.Syntax |= Syntax(b&0x7F) << shift
1910 if b < 0x80 {
1911 break
1912 }
1913 }
1914 default:
1915 iNdEx = preIndex
1916 skippy, err := skipApi(dAtA[iNdEx:])
1917 if err != nil {
1918 return err
1919 }
1920 if (skippy < 0) || (iNdEx+skippy) < 0 {
1921 return ErrInvalidLengthApi
1922 }
1923 if (iNdEx + skippy) > l {
1924 return io.ErrUnexpectedEOF
1925 }
1926 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
1927 iNdEx += skippy
1928 }
1929 }
1930
1931 if iNdEx > l {
1932 return io.ErrUnexpectedEOF
1933 }
1934 return nil
1935 }
1936 func (m *Mixin) Unmarshal(dAtA []byte) error {
1937 l := len(dAtA)
1938 iNdEx := 0
1939 for iNdEx < l {
1940 preIndex := iNdEx
1941 var wire uint64
1942 for shift := uint(0); ; shift += 7 {
1943 if shift >= 64 {
1944 return ErrIntOverflowApi
1945 }
1946 if iNdEx >= l {
1947 return io.ErrUnexpectedEOF
1948 }
1949 b := dAtA[iNdEx]
1950 iNdEx++
1951 wire |= uint64(b&0x7F) << shift
1952 if b < 0x80 {
1953 break
1954 }
1955 }
1956 fieldNum := int32(wire >> 3)
1957 wireType := int(wire & 0x7)
1958 if wireType == 4 {
1959 return fmt.Errorf("proto: Mixin: wiretype end group for non-group")
1960 }
1961 if fieldNum <= 0 {
1962 return fmt.Errorf("proto: Mixin: illegal tag %d (wire type %d)", fieldNum, wire)
1963 }
1964 switch fieldNum {
1965 case 1:
1966 if wireType != 2 {
1967 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
1968 }
1969 var stringLen uint64
1970 for shift := uint(0); ; shift += 7 {
1971 if shift >= 64 {
1972 return ErrIntOverflowApi
1973 }
1974 if iNdEx >= l {
1975 return io.ErrUnexpectedEOF
1976 }
1977 b := dAtA[iNdEx]
1978 iNdEx++
1979 stringLen |= uint64(b&0x7F) << shift
1980 if b < 0x80 {
1981 break
1982 }
1983 }
1984 intStringLen := int(stringLen)
1985 if intStringLen < 0 {
1986 return ErrInvalidLengthApi
1987 }
1988 postIndex := iNdEx + intStringLen
1989 if postIndex < 0 {
1990 return ErrInvalidLengthApi
1991 }
1992 if postIndex > l {
1993 return io.ErrUnexpectedEOF
1994 }
1995 m.Name = string(dAtA[iNdEx:postIndex])
1996 iNdEx = postIndex
1997 case 2:
1998 if wireType != 2 {
1999 return fmt.Errorf("proto: wrong wireType = %d for field Root", wireType)
2000 }
2001 var stringLen uint64
2002 for shift := uint(0); ; shift += 7 {
2003 if shift >= 64 {
2004 return ErrIntOverflowApi
2005 }
2006 if iNdEx >= l {
2007 return io.ErrUnexpectedEOF
2008 }
2009 b := dAtA[iNdEx]
2010 iNdEx++
2011 stringLen |= uint64(b&0x7F) << shift
2012 if b < 0x80 {
2013 break
2014 }
2015 }
2016 intStringLen := int(stringLen)
2017 if intStringLen < 0 {
2018 return ErrInvalidLengthApi
2019 }
2020 postIndex := iNdEx + intStringLen
2021 if postIndex < 0 {
2022 return ErrInvalidLengthApi
2023 }
2024 if postIndex > l {
2025 return io.ErrUnexpectedEOF
2026 }
2027 m.Root = string(dAtA[iNdEx:postIndex])
2028 iNdEx = postIndex
2029 default:
2030 iNdEx = preIndex
2031 skippy, err := skipApi(dAtA[iNdEx:])
2032 if err != nil {
2033 return err
2034 }
2035 if (skippy < 0) || (iNdEx+skippy) < 0 {
2036 return ErrInvalidLengthApi
2037 }
2038 if (iNdEx + skippy) > l {
2039 return io.ErrUnexpectedEOF
2040 }
2041 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
2042 iNdEx += skippy
2043 }
2044 }
2045
2046 if iNdEx > l {
2047 return io.ErrUnexpectedEOF
2048 }
2049 return nil
2050 }
2051 func skipApi(dAtA []byte) (n int, err error) {
2052 l := len(dAtA)
2053 iNdEx := 0
2054 depth := 0
2055 for iNdEx < l {
2056 var wire uint64
2057 for shift := uint(0); ; shift += 7 {
2058 if shift >= 64 {
2059 return 0, ErrIntOverflowApi
2060 }
2061 if iNdEx >= l {
2062 return 0, io.ErrUnexpectedEOF
2063 }
2064 b := dAtA[iNdEx]
2065 iNdEx++
2066 wire |= (uint64(b) & 0x7F) << shift
2067 if b < 0x80 {
2068 break
2069 }
2070 }
2071 wireType := int(wire & 0x7)
2072 switch wireType {
2073 case 0:
2074 for shift := uint(0); ; shift += 7 {
2075 if shift >= 64 {
2076 return 0, ErrIntOverflowApi
2077 }
2078 if iNdEx >= l {
2079 return 0, io.ErrUnexpectedEOF
2080 }
2081 iNdEx++
2082 if dAtA[iNdEx-1] < 0x80 {
2083 break
2084 }
2085 }
2086 case 1:
2087 iNdEx += 8
2088 case 2:
2089 var length int
2090 for shift := uint(0); ; shift += 7 {
2091 if shift >= 64 {
2092 return 0, ErrIntOverflowApi
2093 }
2094 if iNdEx >= l {
2095 return 0, io.ErrUnexpectedEOF
2096 }
2097 b := dAtA[iNdEx]
2098 iNdEx++
2099 length |= (int(b) & 0x7F) << shift
2100 if b < 0x80 {
2101 break
2102 }
2103 }
2104 if length < 0 {
2105 return 0, ErrInvalidLengthApi
2106 }
2107 iNdEx += length
2108 case 3:
2109 depth++
2110 case 4:
2111 if depth == 0 {
2112 return 0, ErrUnexpectedEndOfGroupApi
2113 }
2114 depth--
2115 case 5:
2116 iNdEx += 4
2117 default:
2118 return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
2119 }
2120 if iNdEx < 0 {
2121 return 0, ErrInvalidLengthApi
2122 }
2123 if depth == 0 {
2124 return iNdEx, nil
2125 }
2126 }
2127 return 0, io.ErrUnexpectedEOF
2128 }
2129
2130 var (
2131 ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
2132 ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
2133 ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group")
2134 )
2135
View as plain text