1// Code generated by protoc-gen-gogo. DO NOT EDIT. 2// source: google/protobuf/type.proto 3 4package types 5 6import ( 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 strconv "strconv" 15 strings "strings" 16) 17 18// Reference imports to suppress errors if they are not otherwise used. 19var _ = proto.Marshal 20var _ = fmt.Errorf 21var _ = math.Inf 22 23// This is a compile-time assertion to ensure that this generated file 24// is compatible with the proto package it is being compiled against. 25// A compilation error at this line likely means your copy of the 26// proto package needs to be updated. 27const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 28 29// The syntax in which a protocol buffer element is defined. 30type Syntax int32 31 32const ( 33 // Syntax `proto2`. 34 Syntax_SYNTAX_PROTO2 Syntax = 0 35 // Syntax `proto3`. 36 Syntax_SYNTAX_PROTO3 Syntax = 1 37) 38 39var Syntax_name = map[int32]string{ 40 0: "SYNTAX_PROTO2", 41 1: "SYNTAX_PROTO3", 42} 43 44var Syntax_value = map[string]int32{ 45 "SYNTAX_PROTO2": 0, 46 "SYNTAX_PROTO3": 1, 47} 48 49func (Syntax) EnumDescriptor() ([]byte, []int) { 50 return fileDescriptor_dd271cc1e348c538, []int{0} 51} 52 53// Basic field types. 54type Field_Kind int32 55 56const ( 57 // Field type unknown. 58 Field_TYPE_UNKNOWN Field_Kind = 0 59 // Field type double. 60 Field_TYPE_DOUBLE Field_Kind = 1 61 // Field type float. 62 Field_TYPE_FLOAT Field_Kind = 2 63 // Field type int64. 64 Field_TYPE_INT64 Field_Kind = 3 65 // Field type uint64. 66 Field_TYPE_UINT64 Field_Kind = 4 67 // Field type int32. 68 Field_TYPE_INT32 Field_Kind = 5 69 // Field type fixed64. 70 Field_TYPE_FIXED64 Field_Kind = 6 71 // Field type fixed32. 72 Field_TYPE_FIXED32 Field_Kind = 7 73 // Field type bool. 74 Field_TYPE_BOOL Field_Kind = 8 75 // Field type string. 76 Field_TYPE_STRING Field_Kind = 9 77 // Field type group. Proto2 syntax only, and deprecated. 78 Field_TYPE_GROUP Field_Kind = 10 79 // Field type message. 80 Field_TYPE_MESSAGE Field_Kind = 11 81 // Field type bytes. 82 Field_TYPE_BYTES Field_Kind = 12 83 // Field type uint32. 84 Field_TYPE_UINT32 Field_Kind = 13 85 // Field type enum. 86 Field_TYPE_ENUM Field_Kind = 14 87 // Field type sfixed32. 88 Field_TYPE_SFIXED32 Field_Kind = 15 89 // Field type sfixed64. 90 Field_TYPE_SFIXED64 Field_Kind = 16 91 // Field type sint32. 92 Field_TYPE_SINT32 Field_Kind = 17 93 // Field type sint64. 94 Field_TYPE_SINT64 Field_Kind = 18 95) 96 97var Field_Kind_name = map[int32]string{ 98 0: "TYPE_UNKNOWN", 99 1: "TYPE_DOUBLE", 100 2: "TYPE_FLOAT", 101 3: "TYPE_INT64", 102 4: "TYPE_UINT64", 103 5: "TYPE_INT32", 104 6: "TYPE_FIXED64", 105 7: "TYPE_FIXED32", 106 8: "TYPE_BOOL", 107 9: "TYPE_STRING", 108 10: "TYPE_GROUP", 109 11: "TYPE_MESSAGE", 110 12: "TYPE_BYTES", 111 13: "TYPE_UINT32", 112 14: "TYPE_ENUM", 113 15: "TYPE_SFIXED32", 114 16: "TYPE_SFIXED64", 115 17: "TYPE_SINT32", 116 18: "TYPE_SINT64", 117} 118 119var Field_Kind_value = map[string]int32{ 120 "TYPE_UNKNOWN": 0, 121 "TYPE_DOUBLE": 1, 122 "TYPE_FLOAT": 2, 123 "TYPE_INT64": 3, 124 "TYPE_UINT64": 4, 125 "TYPE_INT32": 5, 126 "TYPE_FIXED64": 6, 127 "TYPE_FIXED32": 7, 128 "TYPE_BOOL": 8, 129 "TYPE_STRING": 9, 130 "TYPE_GROUP": 10, 131 "TYPE_MESSAGE": 11, 132 "TYPE_BYTES": 12, 133 "TYPE_UINT32": 13, 134 "TYPE_ENUM": 14, 135 "TYPE_SFIXED32": 15, 136 "TYPE_SFIXED64": 16, 137 "TYPE_SINT32": 17, 138 "TYPE_SINT64": 18, 139} 140 141func (Field_Kind) EnumDescriptor() ([]byte, []int) { 142 return fileDescriptor_dd271cc1e348c538, []int{1, 0} 143} 144 145// Whether a field is optional, required, or repeated. 146type Field_Cardinality int32 147 148const ( 149 // For fields with unknown cardinality. 150 Field_CARDINALITY_UNKNOWN Field_Cardinality = 0 151 // For optional fields. 152 Field_CARDINALITY_OPTIONAL Field_Cardinality = 1 153 // For required fields. Proto2 syntax only. 154 Field_CARDINALITY_REQUIRED Field_Cardinality = 2 155 // For repeated fields. 156 Field_CARDINALITY_REPEATED Field_Cardinality = 3 157) 158 159var Field_Cardinality_name = map[int32]string{ 160 0: "CARDINALITY_UNKNOWN", 161 1: "CARDINALITY_OPTIONAL", 162 2: "CARDINALITY_REQUIRED", 163 3: "CARDINALITY_REPEATED", 164} 165 166var Field_Cardinality_value = map[string]int32{ 167 "CARDINALITY_UNKNOWN": 0, 168 "CARDINALITY_OPTIONAL": 1, 169 "CARDINALITY_REQUIRED": 2, 170 "CARDINALITY_REPEATED": 3, 171} 172 173func (Field_Cardinality) EnumDescriptor() ([]byte, []int) { 174 return fileDescriptor_dd271cc1e348c538, []int{1, 1} 175} 176 177// A protocol buffer message type. 178type Type struct { 179 // The fully qualified message name. 180 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 181 // The list of fields. 182 Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` 183 // The list of types appearing in `oneof` definitions in this type. 184 Oneofs []string `protobuf:"bytes,3,rep,name=oneofs,proto3" json:"oneofs,omitempty"` 185 // The protocol buffer options. 186 Options []*Option `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` 187 // The source context. 188 SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"` 189 // The source syntax. 190 Syntax Syntax `protobuf:"varint,6,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"` 191 XXX_NoUnkeyedLiteral struct{} `json:"-"` 192 XXX_unrecognized []byte `json:"-"` 193 XXX_sizecache int32 `json:"-"` 194} 195 196func (m *Type) Reset() { *m = Type{} } 197func (*Type) ProtoMessage() {} 198func (*Type) Descriptor() ([]byte, []int) { 199 return fileDescriptor_dd271cc1e348c538, []int{0} 200} 201func (m *Type) XXX_Unmarshal(b []byte) error { 202 return m.Unmarshal(b) 203} 204func (m *Type) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 205 if deterministic { 206 return xxx_messageInfo_Type.Marshal(b, m, deterministic) 207 } else { 208 b = b[:cap(b)] 209 n, err := m.MarshalToSizedBuffer(b) 210 if err != nil { 211 return nil, err 212 } 213 return b[:n], nil 214 } 215} 216func (m *Type) XXX_Merge(src proto.Message) { 217 xxx_messageInfo_Type.Merge(m, src) 218} 219func (m *Type) XXX_Size() int { 220 return m.Size() 221} 222func (m *Type) XXX_DiscardUnknown() { 223 xxx_messageInfo_Type.DiscardUnknown(m) 224} 225 226var xxx_messageInfo_Type proto.InternalMessageInfo 227 228func (m *Type) GetName() string { 229 if m != nil { 230 return m.Name 231 } 232 return "" 233} 234 235func (m *Type) GetFields() []*Field { 236 if m != nil { 237 return m.Fields 238 } 239 return nil 240} 241 242func (m *Type) GetOneofs() []string { 243 if m != nil { 244 return m.Oneofs 245 } 246 return nil 247} 248 249func (m *Type) GetOptions() []*Option { 250 if m != nil { 251 return m.Options 252 } 253 return nil 254} 255 256func (m *Type) GetSourceContext() *SourceContext { 257 if m != nil { 258 return m.SourceContext 259 } 260 return nil 261} 262 263func (m *Type) GetSyntax() Syntax { 264 if m != nil { 265 return m.Syntax 266 } 267 return Syntax_SYNTAX_PROTO2 268} 269 270func (*Type) XXX_MessageName() string { 271 return "google.protobuf.Type" 272} 273 274// A single field of a message type. 275type Field struct { 276 // The field type. 277 Kind Field_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=google.protobuf.Field_Kind" json:"kind,omitempty"` 278 // The field cardinality. 279 Cardinality Field_Cardinality `protobuf:"varint,2,opt,name=cardinality,proto3,enum=google.protobuf.Field_Cardinality" json:"cardinality,omitempty"` 280 // The field number. 281 Number int32 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` 282 // The field name. 283 Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` 284 // The field type URL, without the scheme, for message or enumeration 285 // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. 286 TypeUrl string `protobuf:"bytes,6,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` 287 // The index of the field type in `Type.oneofs`, for message or enumeration 288 // types. The first type has index 1; zero means the type is not in the list. 289 OneofIndex int32 `protobuf:"varint,7,opt,name=oneof_index,json=oneofIndex,proto3" json:"oneof_index,omitempty"` 290 // Whether to use alternative packed wire representation. 291 Packed bool `protobuf:"varint,8,opt,name=packed,proto3" json:"packed,omitempty"` 292 // The protocol buffer options. 293 Options []*Option `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"` 294 // The field JSON name. 295 JsonName string `protobuf:"bytes,10,opt,name=json_name,json=jsonName,proto3" json:"json_name,omitempty"` 296 // The string value of the default value of this field. Proto2 syntax only. 297 DefaultValue string `protobuf:"bytes,11,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"` 298 XXX_NoUnkeyedLiteral struct{} `json:"-"` 299 XXX_unrecognized []byte `json:"-"` 300 XXX_sizecache int32 `json:"-"` 301} 302 303func (m *Field) Reset() { *m = Field{} } 304func (*Field) ProtoMessage() {} 305func (*Field) Descriptor() ([]byte, []int) { 306 return fileDescriptor_dd271cc1e348c538, []int{1} 307} 308func (m *Field) XXX_Unmarshal(b []byte) error { 309 return m.Unmarshal(b) 310} 311func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 312 if deterministic { 313 return xxx_messageInfo_Field.Marshal(b, m, deterministic) 314 } else { 315 b = b[:cap(b)] 316 n, err := m.MarshalToSizedBuffer(b) 317 if err != nil { 318 return nil, err 319 } 320 return b[:n], nil 321 } 322} 323func (m *Field) XXX_Merge(src proto.Message) { 324 xxx_messageInfo_Field.Merge(m, src) 325} 326func (m *Field) XXX_Size() int { 327 return m.Size() 328} 329func (m *Field) XXX_DiscardUnknown() { 330 xxx_messageInfo_Field.DiscardUnknown(m) 331} 332 333var xxx_messageInfo_Field proto.InternalMessageInfo 334 335func (m *Field) GetKind() Field_Kind { 336 if m != nil { 337 return m.Kind 338 } 339 return Field_TYPE_UNKNOWN 340} 341 342func (m *Field) GetCardinality() Field_Cardinality { 343 if m != nil { 344 return m.Cardinality 345 } 346 return Field_CARDINALITY_UNKNOWN 347} 348 349func (m *Field) GetNumber() int32 { 350 if m != nil { 351 return m.Number 352 } 353 return 0 354} 355 356func (m *Field) GetName() string { 357 if m != nil { 358 return m.Name 359 } 360 return "" 361} 362 363func (m *Field) GetTypeUrl() string { 364 if m != nil { 365 return m.TypeUrl 366 } 367 return "" 368} 369 370func (m *Field) GetOneofIndex() int32 { 371 if m != nil { 372 return m.OneofIndex 373 } 374 return 0 375} 376 377func (m *Field) GetPacked() bool { 378 if m != nil { 379 return m.Packed 380 } 381 return false 382} 383 384func (m *Field) GetOptions() []*Option { 385 if m != nil { 386 return m.Options 387 } 388 return nil 389} 390 391func (m *Field) GetJsonName() string { 392 if m != nil { 393 return m.JsonName 394 } 395 return "" 396} 397 398func (m *Field) GetDefaultValue() string { 399 if m != nil { 400 return m.DefaultValue 401 } 402 return "" 403} 404 405func (*Field) XXX_MessageName() string { 406 return "google.protobuf.Field" 407} 408 409// Enum type definition. 410type Enum struct { 411 // Enum type name. 412 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 413 // Enum value definitions. 414 Enumvalue []*EnumValue `protobuf:"bytes,2,rep,name=enumvalue,proto3" json:"enumvalue,omitempty"` 415 // Protocol buffer options. 416 Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` 417 // The source context. 418 SourceContext *SourceContext `protobuf:"bytes,4,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"` 419 // The source syntax. 420 Syntax Syntax `protobuf:"varint,5,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"` 421 XXX_NoUnkeyedLiteral struct{} `json:"-"` 422 XXX_unrecognized []byte `json:"-"` 423 XXX_sizecache int32 `json:"-"` 424} 425 426func (m *Enum) Reset() { *m = Enum{} } 427func (*Enum) ProtoMessage() {} 428func (*Enum) Descriptor() ([]byte, []int) { 429 return fileDescriptor_dd271cc1e348c538, []int{2} 430} 431func (m *Enum) XXX_Unmarshal(b []byte) error { 432 return m.Unmarshal(b) 433} 434func (m *Enum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 435 if deterministic { 436 return xxx_messageInfo_Enum.Marshal(b, m, deterministic) 437 } else { 438 b = b[:cap(b)] 439 n, err := m.MarshalToSizedBuffer(b) 440 if err != nil { 441 return nil, err 442 } 443 return b[:n], nil 444 } 445} 446func (m *Enum) XXX_Merge(src proto.Message) { 447 xxx_messageInfo_Enum.Merge(m, src) 448} 449func (m *Enum) XXX_Size() int { 450 return m.Size() 451} 452func (m *Enum) XXX_DiscardUnknown() { 453 xxx_messageInfo_Enum.DiscardUnknown(m) 454} 455 456var xxx_messageInfo_Enum proto.InternalMessageInfo 457 458func (m *Enum) GetName() string { 459 if m != nil { 460 return m.Name 461 } 462 return "" 463} 464 465func (m *Enum) GetEnumvalue() []*EnumValue { 466 if m != nil { 467 return m.Enumvalue 468 } 469 return nil 470} 471 472func (m *Enum) GetOptions() []*Option { 473 if m != nil { 474 return m.Options 475 } 476 return nil 477} 478 479func (m *Enum) GetSourceContext() *SourceContext { 480 if m != nil { 481 return m.SourceContext 482 } 483 return nil 484} 485 486func (m *Enum) GetSyntax() Syntax { 487 if m != nil { 488 return m.Syntax 489 } 490 return Syntax_SYNTAX_PROTO2 491} 492 493func (*Enum) XXX_MessageName() string { 494 return "google.protobuf.Enum" 495} 496 497// Enum value definition. 498type EnumValue struct { 499 // Enum value name. 500 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 501 // Enum value number. 502 Number int32 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` 503 // Protocol buffer options. 504 Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` 505 XXX_NoUnkeyedLiteral struct{} `json:"-"` 506 XXX_unrecognized []byte `json:"-"` 507 XXX_sizecache int32 `json:"-"` 508} 509 510func (m *EnumValue) Reset() { *m = EnumValue{} } 511func (*EnumValue) ProtoMessage() {} 512func (*EnumValue) Descriptor() ([]byte, []int) { 513 return fileDescriptor_dd271cc1e348c538, []int{3} 514} 515func (m *EnumValue) XXX_Unmarshal(b []byte) error { 516 return m.Unmarshal(b) 517} 518func (m *EnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 519 if deterministic { 520 return xxx_messageInfo_EnumValue.Marshal(b, m, deterministic) 521 } else { 522 b = b[:cap(b)] 523 n, err := m.MarshalToSizedBuffer(b) 524 if err != nil { 525 return nil, err 526 } 527 return b[:n], nil 528 } 529} 530func (m *EnumValue) XXX_Merge(src proto.Message) { 531 xxx_messageInfo_EnumValue.Merge(m, src) 532} 533func (m *EnumValue) XXX_Size() int { 534 return m.Size() 535} 536func (m *EnumValue) XXX_DiscardUnknown() { 537 xxx_messageInfo_EnumValue.DiscardUnknown(m) 538} 539 540var xxx_messageInfo_EnumValue proto.InternalMessageInfo 541 542func (m *EnumValue) GetName() string { 543 if m != nil { 544 return m.Name 545 } 546 return "" 547} 548 549func (m *EnumValue) GetNumber() int32 { 550 if m != nil { 551 return m.Number 552 } 553 return 0 554} 555 556func (m *EnumValue) GetOptions() []*Option { 557 if m != nil { 558 return m.Options 559 } 560 return nil 561} 562 563func (*EnumValue) XXX_MessageName() string { 564 return "google.protobuf.EnumValue" 565} 566 567// A protocol buffer option, which can be attached to a message, field, 568// enumeration, etc. 569type Option struct { 570 // The option's name. For protobuf built-in options (options defined in 571 // descriptor.proto), this is the short name. For example, `"map_entry"`. 572 // For custom options, it should be the fully-qualified name. For example, 573 // `"google.api.http"`. 574 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 575 // The option's value packed in an Any message. If the value is a primitive, 576 // the corresponding wrapper type defined in google/protobuf/wrappers.proto 577 // should be used. If the value is an enum, it should be stored as an int32 578 // value using the google.protobuf.Int32Value type. 579 Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 580 XXX_NoUnkeyedLiteral struct{} `json:"-"` 581 XXX_unrecognized []byte `json:"-"` 582 XXX_sizecache int32 `json:"-"` 583} 584 585func (m *Option) Reset() { *m = Option{} } 586func (*Option) ProtoMessage() {} 587func (*Option) Descriptor() ([]byte, []int) { 588 return fileDescriptor_dd271cc1e348c538, []int{4} 589} 590func (m *Option) XXX_Unmarshal(b []byte) error { 591 return m.Unmarshal(b) 592} 593func (m *Option) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 594 if deterministic { 595 return xxx_messageInfo_Option.Marshal(b, m, deterministic) 596 } else { 597 b = b[:cap(b)] 598 n, err := m.MarshalToSizedBuffer(b) 599 if err != nil { 600 return nil, err 601 } 602 return b[:n], nil 603 } 604} 605func (m *Option) XXX_Merge(src proto.Message) { 606 xxx_messageInfo_Option.Merge(m, src) 607} 608func (m *Option) XXX_Size() int { 609 return m.Size() 610} 611func (m *Option) XXX_DiscardUnknown() { 612 xxx_messageInfo_Option.DiscardUnknown(m) 613} 614 615var xxx_messageInfo_Option proto.InternalMessageInfo 616 617func (m *Option) GetName() string { 618 if m != nil { 619 return m.Name 620 } 621 return "" 622} 623 624func (m *Option) GetValue() *Any { 625 if m != nil { 626 return m.Value 627 } 628 return nil 629} 630 631func (*Option) XXX_MessageName() string { 632 return "google.protobuf.Option" 633} 634func init() { 635 proto.RegisterEnum("google.protobuf.Syntax", Syntax_name, Syntax_value) 636 proto.RegisterEnum("google.protobuf.Field_Kind", Field_Kind_name, Field_Kind_value) 637 proto.RegisterEnum("google.protobuf.Field_Cardinality", Field_Cardinality_name, Field_Cardinality_value) 638 proto.RegisterType((*Type)(nil), "google.protobuf.Type") 639 proto.RegisterType((*Field)(nil), "google.protobuf.Field") 640 proto.RegisterType((*Enum)(nil), "google.protobuf.Enum") 641 proto.RegisterType((*EnumValue)(nil), "google.protobuf.EnumValue") 642 proto.RegisterType((*Option)(nil), "google.protobuf.Option") 643} 644 645func init() { proto.RegisterFile("google/protobuf/type.proto", fileDescriptor_dd271cc1e348c538) } 646 647var fileDescriptor_dd271cc1e348c538 = []byte{ 648 // 840 bytes of a gzipped FileDescriptorProto 649 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x73, 0xda, 0x46, 650 0x14, 0xf6, 0x0a, 0x21, 0xa3, 0x87, 0xc1, 0x9b, 0x4d, 0x26, 0x51, 0x9c, 0x19, 0x95, 0xa1, 0x3d, 651 0x30, 0x39, 0xe0, 0x29, 0x78, 0x3c, 0xbd, 0x82, 0x91, 0x29, 0x63, 0x22, 0xa9, 0x8b, 0x68, 0xe2, 652 0x5e, 0x18, 0x0c, 0x72, 0x86, 0x44, 0xac, 0x18, 0x24, 0x5a, 0x73, 0xeb, 0x4c, 0xcf, 0xfd, 0x27, 653 0x7a, 0xea, 0xf4, 0xdc, 0x3f, 0xc2, 0xc7, 0x1e, 0x7b, 0xac, 0xc9, 0xa5, 0xc7, 0x1c, 0x73, 0x6b, 654 0x67, 0x57, 0x20, 0x8b, 0x1f, 0x9d, 0x49, 0xdb, 0x1b, 0xef, 0xfb, 0xbe, 0xf7, 0x73, 0x9f, 0x1e, 655 0x70, 0xf4, 0xda, 0xf7, 0x5f, 0x7b, 0xee, 0xf1, 0x64, 0xea, 0x87, 0xfe, 0xd5, 0xec, 0xfa, 0x38, 656 0x9c, 0x4f, 0xdc, 0xb2, 0xb0, 0xc8, 0x61, 0xc4, 0x95, 0x57, 0xdc, 0xd1, 0xd3, 0x4d, 0x71, 0x9f, 657 0xcd, 0x23, 0xf6, 0xe8, 0xb3, 0x4d, 0x2a, 0xf0, 0x67, 0xd3, 0x81, 0xdb, 0x1b, 0xf8, 0x2c, 0x74, 658 0x6f, 0xc2, 0x48, 0x55, 0xfc, 0x51, 0x02, 0xd9, 0x99, 0x4f, 0x5c, 0x42, 0x40, 0x66, 0xfd, 0xb1, 659 0xab, 0xa1, 0x02, 0x2a, 0xa9, 0x54, 0xfc, 0x26, 0x65, 0x50, 0xae, 0x47, 0xae, 0x37, 0x0c, 0x34, 660 0xa9, 0x90, 0x2a, 0x65, 0x2b, 0x8f, 0xcb, 0x1b, 0xf9, 0xcb, 0xe7, 0x9c, 0xa6, 0x4b, 0x15, 0x79, 661 0x0c, 0x8a, 0xcf, 0x5c, 0xff, 0x3a, 0xd0, 0x52, 0x85, 0x54, 0x49, 0xa5, 0x4b, 0x8b, 0x7c, 0x0e, 662 0xfb, 0xfe, 0x24, 0x1c, 0xf9, 0x2c, 0xd0, 0x64, 0x11, 0xe8, 0xc9, 0x56, 0x20, 0x4b, 0xf0, 0x74, 663 0xa5, 0x23, 0x06, 0xe4, 0xd7, 0xeb, 0xd5, 0xd2, 0x05, 0x54, 0xca, 0x56, 0xf4, 0x2d, 0xcf, 0x8e, 664 0x90, 0x9d, 0x45, 0x2a, 0x9a, 0x0b, 0x92, 0x26, 0x39, 0x06, 0x25, 0x98, 0xb3, 0xb0, 0x7f, 0xa3, 665 0x29, 0x05, 0x54, 0xca, 0xef, 0x48, 0xdc, 0x11, 0x34, 0x5d, 0xca, 0x8a, 0xbf, 0x2a, 0x90, 0x16, 666 0x4d, 0x91, 0x63, 0x90, 0xdf, 0x8e, 0xd8, 0x50, 0x0c, 0x24, 0x5f, 0x79, 0xb6, 0xbb, 0xf5, 0xf2, 667 0xc5, 0x88, 0x0d, 0xa9, 0x10, 0x92, 0x06, 0x64, 0x07, 0xfd, 0xe9, 0x70, 0xc4, 0xfa, 0xde, 0x28, 668 0x9c, 0x6b, 0x92, 0xf0, 0x2b, 0xfe, 0x83, 0xdf, 0xd9, 0xbd, 0x92, 0x26, 0xdd, 0xf8, 0x0c, 0xd9, 669 0x6c, 0x7c, 0xe5, 0x4e, 0xb5, 0x54, 0x01, 0x95, 0xd2, 0x74, 0x69, 0xc5, 0xef, 0x23, 0x27, 0xde, 670 0xe7, 0x29, 0x64, 0xf8, 0x72, 0xf4, 0x66, 0x53, 0x4f, 0xf4, 0xa7, 0xd2, 0x7d, 0x6e, 0x77, 0xa7, 671 0x1e, 0xf9, 0x04, 0xb2, 0x62, 0xf8, 0xbd, 0x11, 0x1b, 0xba, 0x37, 0xda, 0xbe, 0x88, 0x05, 0x02, 672 0x6a, 0x71, 0x84, 0xe7, 0x99, 0xf4, 0x07, 0x6f, 0xdd, 0xa1, 0x96, 0x29, 0xa0, 0x52, 0x86, 0x2e, 673 0xad, 0xe4, 0x5b, 0xa9, 0x1f, 0xf9, 0x56, 0xcf, 0x40, 0x7d, 0x13, 0xf8, 0xac, 0x27, 0xea, 0x03, 674 0x51, 0x47, 0x86, 0x03, 0x26, 0xaf, 0xf1, 0x53, 0xc8, 0x0d, 0xdd, 0xeb, 0xfe, 0xcc, 0x0b, 0x7b, 675 0xdf, 0xf6, 0xbd, 0x99, 0xab, 0x65, 0x85, 0xe0, 0x60, 0x09, 0x7e, 0xcd, 0xb1, 0xe2, 0xad, 0x04, 676 0x32, 0x9f, 0x24, 0xc1, 0x70, 0xe0, 0x5c, 0xda, 0x46, 0xaf, 0x6b, 0x5e, 0x98, 0xd6, 0x4b, 0x13, 677 0xef, 0x91, 0x43, 0xc8, 0x0a, 0xa4, 0x61, 0x75, 0xeb, 0x6d, 0x03, 0x23, 0x92, 0x07, 0x10, 0xc0, 678 0x79, 0xdb, 0xaa, 0x39, 0x58, 0x8a, 0xed, 0x96, 0xe9, 0x9c, 0x9e, 0xe0, 0x54, 0xec, 0xd0, 0x8d, 679 0x00, 0x39, 0x29, 0xa8, 0x56, 0x70, 0x3a, 0xce, 0x71, 0xde, 0x7a, 0x65, 0x34, 0x4e, 0x4f, 0xb0, 680 0xb2, 0x8e, 0x54, 0x2b, 0x78, 0x9f, 0xe4, 0x40, 0x15, 0x48, 0xdd, 0xb2, 0xda, 0x38, 0x13, 0xc7, 681 0xec, 0x38, 0xb4, 0x65, 0x36, 0xb1, 0x1a, 0xc7, 0x6c, 0x52, 0xab, 0x6b, 0x63, 0x88, 0x23, 0xbc, 682 0x30, 0x3a, 0x9d, 0x5a, 0xd3, 0xc0, 0xd9, 0x58, 0x51, 0xbf, 0x74, 0x8c, 0x0e, 0x3e, 0x58, 0x2b, 683 0xab, 0x5a, 0xc1, 0xb9, 0x38, 0x85, 0x61, 0x76, 0x5f, 0xe0, 0x3c, 0x79, 0x00, 0xb9, 0x28, 0xc5, 684 0xaa, 0x88, 0xc3, 0x0d, 0xe8, 0xf4, 0x04, 0xe3, 0xfb, 0x42, 0xa2, 0x28, 0x0f, 0xd6, 0x80, 0xd3, 685 0x13, 0x4c, 0x8a, 0x21, 0x64, 0x13, 0xbb, 0x45, 0x9e, 0xc0, 0xc3, 0xb3, 0x1a, 0x6d, 0xb4, 0xcc, 686 0x5a, 0xbb, 0xe5, 0x5c, 0x26, 0xe6, 0xaa, 0xc1, 0xa3, 0x24, 0x61, 0xd9, 0x4e, 0xcb, 0x32, 0x6b, 687 0x6d, 0x8c, 0x36, 0x19, 0x6a, 0x7c, 0xd5, 0x6d, 0x51, 0xa3, 0x81, 0xa5, 0x6d, 0xc6, 0x36, 0x6a, 688 0x8e, 0xd1, 0xc0, 0xa9, 0xe2, 0x5f, 0x08, 0x64, 0x83, 0xcd, 0xc6, 0x3b, 0xcf, 0xc8, 0x17, 0xa0, 689 0xba, 0x6c, 0x36, 0x8e, 0x9e, 0x3f, 0xba, 0x24, 0x47, 0x5b, 0x4b, 0xc5, 0xbd, 0xc5, 0x32, 0xd0, 690 0x7b, 0x71, 0x72, 0x19, 0x53, 0xff, 0xf9, 0x70, 0xc8, 0xff, 0xef, 0x70, 0xa4, 0x3f, 0xee, 0x70, 691 0xbc, 0x01, 0x35, 0x6e, 0x61, 0xe7, 0x14, 0xee, 0x3f, 0x6c, 0x69, 0xed, 0xc3, 0xfe, 0xf7, 0x3d, 692 0x16, 0xbf, 0x04, 0x25, 0x82, 0x76, 0x26, 0x7a, 0x0e, 0xe9, 0xd5, 0xa8, 0x79, 0xe3, 0x8f, 0xb6, 693 0xc2, 0xd5, 0xd8, 0x9c, 0x46, 0x92, 0xe7, 0x65, 0x50, 0xa2, 0x3e, 0xf8, 0xb2, 0x75, 0x2e, 0x4d, 694 0xa7, 0xf6, 0xaa, 0x67, 0x53, 0xcb, 0xb1, 0x2a, 0x78, 0x6f, 0x13, 0xaa, 0x62, 0x54, 0xff, 0x01, 695 0xfd, 0x7e, 0xa7, 0xef, 0xbd, 0xbf, 0xd3, 0xd1, 0x87, 0x3b, 0x1d, 0x7d, 0xbf, 0xd0, 0xd1, 0xcf, 696 0x0b, 0x1d, 0xdd, 0x2e, 0x74, 0xf4, 0xdb, 0x42, 0x47, 0x7f, 0x2c, 0x74, 0xf4, 0xe7, 0x42, 0xdf, 697 0x7b, 0xcf, 0xf1, 0x77, 0x3a, 0xba, 0x7d, 0xa7, 0x23, 0x78, 0x38, 0xf0, 0xc7, 0x9b, 0x25, 0xd4, 698 0x55, 0xfe, 0x9f, 0x63, 0x73, 0xcb, 0x46, 0xdf, 0xa4, 0xf9, 0xd1, 0x0a, 0x3e, 0x20, 0xf4, 0x93, 699 0x94, 0x6a, 0xda, 0xf5, 0x5f, 0x24, 0xbd, 0x19, 0xc9, 0xed, 0x55, 0xc5, 0x2f, 0x5d, 0xcf, 0xbb, 700 0x60, 0xfe, 0x77, 0x8c, 0xbb, 0x05, 0x57, 0x8a, 0x88, 0x53, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, 701 0xbc, 0x2a, 0x5e, 0x82, 0x2b, 0x07, 0x00, 0x00, 702} 703 704func (this *Type) Compare(that interface{}) int { 705 if that == nil { 706 if this == nil { 707 return 0 708 } 709 return 1 710 } 711 712 that1, ok := that.(*Type) 713 if !ok { 714 that2, ok := that.(Type) 715 if ok { 716 that1 = &that2 717 } else { 718 return 1 719 } 720 } 721 if that1 == nil { 722 if this == nil { 723 return 0 724 } 725 return 1 726 } else if this == nil { 727 return -1 728 } 729 if this.Name != that1.Name { 730 if this.Name < that1.Name { 731 return -1 732 } 733 return 1 734 } 735 if len(this.Fields) != len(that1.Fields) { 736 if len(this.Fields) < len(that1.Fields) { 737 return -1 738 } 739 return 1 740 } 741 for i := range this.Fields { 742 if c := this.Fields[i].Compare(that1.Fields[i]); c != 0 { 743 return c 744 } 745 } 746 if len(this.Oneofs) != len(that1.Oneofs) { 747 if len(this.Oneofs) < len(that1.Oneofs) { 748 return -1 749 } 750 return 1 751 } 752 for i := range this.Oneofs { 753 if this.Oneofs[i] != that1.Oneofs[i] { 754 if this.Oneofs[i] < that1.Oneofs[i] { 755 return -1 756 } 757 return 1 758 } 759 } 760 if len(this.Options) != len(that1.Options) { 761 if len(this.Options) < len(that1.Options) { 762 return -1 763 } 764 return 1 765 } 766 for i := range this.Options { 767 if c := this.Options[i].Compare(that1.Options[i]); c != 0 { 768 return c 769 } 770 } 771 if c := this.SourceContext.Compare(that1.SourceContext); c != 0 { 772 return c 773 } 774 if this.Syntax != that1.Syntax { 775 if this.Syntax < that1.Syntax { 776 return -1 777 } 778 return 1 779 } 780 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 781 return c 782 } 783 return 0 784} 785func (this *Field) Compare(that interface{}) int { 786 if that == nil { 787 if this == nil { 788 return 0 789 } 790 return 1 791 } 792 793 that1, ok := that.(*Field) 794 if !ok { 795 that2, ok := that.(Field) 796 if ok { 797 that1 = &that2 798 } else { 799 return 1 800 } 801 } 802 if that1 == nil { 803 if this == nil { 804 return 0 805 } 806 return 1 807 } else if this == nil { 808 return -1 809 } 810 if this.Kind != that1.Kind { 811 if this.Kind < that1.Kind { 812 return -1 813 } 814 return 1 815 } 816 if this.Cardinality != that1.Cardinality { 817 if this.Cardinality < that1.Cardinality { 818 return -1 819 } 820 return 1 821 } 822 if this.Number != that1.Number { 823 if this.Number < that1.Number { 824 return -1 825 } 826 return 1 827 } 828 if this.Name != that1.Name { 829 if this.Name < that1.Name { 830 return -1 831 } 832 return 1 833 } 834 if this.TypeUrl != that1.TypeUrl { 835 if this.TypeUrl < that1.TypeUrl { 836 return -1 837 } 838 return 1 839 } 840 if this.OneofIndex != that1.OneofIndex { 841 if this.OneofIndex < that1.OneofIndex { 842 return -1 843 } 844 return 1 845 } 846 if this.Packed != that1.Packed { 847 if !this.Packed { 848 return -1 849 } 850 return 1 851 } 852 if len(this.Options) != len(that1.Options) { 853 if len(this.Options) < len(that1.Options) { 854 return -1 855 } 856 return 1 857 } 858 for i := range this.Options { 859 if c := this.Options[i].Compare(that1.Options[i]); c != 0 { 860 return c 861 } 862 } 863 if this.JsonName != that1.JsonName { 864 if this.JsonName < that1.JsonName { 865 return -1 866 } 867 return 1 868 } 869 if this.DefaultValue != that1.DefaultValue { 870 if this.DefaultValue < that1.DefaultValue { 871 return -1 872 } 873 return 1 874 } 875 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 876 return c 877 } 878 return 0 879} 880func (this *Enum) Compare(that interface{}) int { 881 if that == nil { 882 if this == nil { 883 return 0 884 } 885 return 1 886 } 887 888 that1, ok := that.(*Enum) 889 if !ok { 890 that2, ok := that.(Enum) 891 if ok { 892 that1 = &that2 893 } else { 894 return 1 895 } 896 } 897 if that1 == nil { 898 if this == nil { 899 return 0 900 } 901 return 1 902 } else if this == nil { 903 return -1 904 } 905 if this.Name != that1.Name { 906 if this.Name < that1.Name { 907 return -1 908 } 909 return 1 910 } 911 if len(this.Enumvalue) != len(that1.Enumvalue) { 912 if len(this.Enumvalue) < len(that1.Enumvalue) { 913 return -1 914 } 915 return 1 916 } 917 for i := range this.Enumvalue { 918 if c := this.Enumvalue[i].Compare(that1.Enumvalue[i]); c != 0 { 919 return c 920 } 921 } 922 if len(this.Options) != len(that1.Options) { 923 if len(this.Options) < len(that1.Options) { 924 return -1 925 } 926 return 1 927 } 928 for i := range this.Options { 929 if c := this.Options[i].Compare(that1.Options[i]); c != 0 { 930 return c 931 } 932 } 933 if c := this.SourceContext.Compare(that1.SourceContext); c != 0 { 934 return c 935 } 936 if this.Syntax != that1.Syntax { 937 if this.Syntax < that1.Syntax { 938 return -1 939 } 940 return 1 941 } 942 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 943 return c 944 } 945 return 0 946} 947func (this *EnumValue) Compare(that interface{}) int { 948 if that == nil { 949 if this == nil { 950 return 0 951 } 952 return 1 953 } 954 955 that1, ok := that.(*EnumValue) 956 if !ok { 957 that2, ok := that.(EnumValue) 958 if ok { 959 that1 = &that2 960 } else { 961 return 1 962 } 963 } 964 if that1 == nil { 965 if this == nil { 966 return 0 967 } 968 return 1 969 } else if this == nil { 970 return -1 971 } 972 if this.Name != that1.Name { 973 if this.Name < that1.Name { 974 return -1 975 } 976 return 1 977 } 978 if this.Number != that1.Number { 979 if this.Number < that1.Number { 980 return -1 981 } 982 return 1 983 } 984 if len(this.Options) != len(that1.Options) { 985 if len(this.Options) < len(that1.Options) { 986 return -1 987 } 988 return 1 989 } 990 for i := range this.Options { 991 if c := this.Options[i].Compare(that1.Options[i]); c != 0 { 992 return c 993 } 994 } 995 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 996 return c 997 } 998 return 0 999} 1000func (this *Option) Compare(that interface{}) int { 1001 if that == nil { 1002 if this == nil { 1003 return 0 1004 } 1005 return 1 1006 } 1007 1008 that1, ok := that.(*Option) 1009 if !ok { 1010 that2, ok := that.(Option) 1011 if ok { 1012 that1 = &that2 1013 } else { 1014 return 1 1015 } 1016 } 1017 if that1 == nil { 1018 if this == nil { 1019 return 0 1020 } 1021 return 1 1022 } else if this == nil { 1023 return -1 1024 } 1025 if this.Name != that1.Name { 1026 if this.Name < that1.Name { 1027 return -1 1028 } 1029 return 1 1030 } 1031 if c := this.Value.Compare(that1.Value); c != 0 { 1032 return c 1033 } 1034 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 1035 return c 1036 } 1037 return 0 1038} 1039func (x Syntax) String() string { 1040 s, ok := Syntax_name[int32(x)] 1041 if ok { 1042 return s 1043 } 1044 return strconv.Itoa(int(x)) 1045} 1046func (x Field_Kind) String() string { 1047 s, ok := Field_Kind_name[int32(x)] 1048 if ok { 1049 return s 1050 } 1051 return strconv.Itoa(int(x)) 1052} 1053func (x Field_Cardinality) String() string { 1054 s, ok := Field_Cardinality_name[int32(x)] 1055 if ok { 1056 return s 1057 } 1058 return strconv.Itoa(int(x)) 1059} 1060func (this *Type) Equal(that interface{}) bool { 1061 if that == nil { 1062 return this == nil 1063 } 1064 1065 that1, ok := that.(*Type) 1066 if !ok { 1067 that2, ok := that.(Type) 1068 if ok { 1069 that1 = &that2 1070 } else { 1071 return false 1072 } 1073 } 1074 if that1 == nil { 1075 return this == nil 1076 } else if this == nil { 1077 return false 1078 } 1079 if this.Name != that1.Name { 1080 return false 1081 } 1082 if len(this.Fields) != len(that1.Fields) { 1083 return false 1084 } 1085 for i := range this.Fields { 1086 if !this.Fields[i].Equal(that1.Fields[i]) { 1087 return false 1088 } 1089 } 1090 if len(this.Oneofs) != len(that1.Oneofs) { 1091 return false 1092 } 1093 for i := range this.Oneofs { 1094 if this.Oneofs[i] != that1.Oneofs[i] { 1095 return false 1096 } 1097 } 1098 if len(this.Options) != len(that1.Options) { 1099 return false 1100 } 1101 for i := range this.Options { 1102 if !this.Options[i].Equal(that1.Options[i]) { 1103 return false 1104 } 1105 } 1106 if !this.SourceContext.Equal(that1.SourceContext) { 1107 return false 1108 } 1109 if this.Syntax != that1.Syntax { 1110 return false 1111 } 1112 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 1113 return false 1114 } 1115 return true 1116} 1117func (this *Field) Equal(that interface{}) bool { 1118 if that == nil { 1119 return this == nil 1120 } 1121 1122 that1, ok := that.(*Field) 1123 if !ok { 1124 that2, ok := that.(Field) 1125 if ok { 1126 that1 = &that2 1127 } else { 1128 return false 1129 } 1130 } 1131 if that1 == nil { 1132 return this == nil 1133 } else if this == nil { 1134 return false 1135 } 1136 if this.Kind != that1.Kind { 1137 return false 1138 } 1139 if this.Cardinality != that1.Cardinality { 1140 return false 1141 } 1142 if this.Number != that1.Number { 1143 return false 1144 } 1145 if this.Name != that1.Name { 1146 return false 1147 } 1148 if this.TypeUrl != that1.TypeUrl { 1149 return false 1150 } 1151 if this.OneofIndex != that1.OneofIndex { 1152 return false 1153 } 1154 if this.Packed != that1.Packed { 1155 return false 1156 } 1157 if len(this.Options) != len(that1.Options) { 1158 return false 1159 } 1160 for i := range this.Options { 1161 if !this.Options[i].Equal(that1.Options[i]) { 1162 return false 1163 } 1164 } 1165 if this.JsonName != that1.JsonName { 1166 return false 1167 } 1168 if this.DefaultValue != that1.DefaultValue { 1169 return false 1170 } 1171 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 1172 return false 1173 } 1174 return true 1175} 1176func (this *Enum) Equal(that interface{}) bool { 1177 if that == nil { 1178 return this == nil 1179 } 1180 1181 that1, ok := that.(*Enum) 1182 if !ok { 1183 that2, ok := that.(Enum) 1184 if ok { 1185 that1 = &that2 1186 } else { 1187 return false 1188 } 1189 } 1190 if that1 == nil { 1191 return this == nil 1192 } else if this == nil { 1193 return false 1194 } 1195 if this.Name != that1.Name { 1196 return false 1197 } 1198 if len(this.Enumvalue) != len(that1.Enumvalue) { 1199 return false 1200 } 1201 for i := range this.Enumvalue { 1202 if !this.Enumvalue[i].Equal(that1.Enumvalue[i]) { 1203 return false 1204 } 1205 } 1206 if len(this.Options) != len(that1.Options) { 1207 return false 1208 } 1209 for i := range this.Options { 1210 if !this.Options[i].Equal(that1.Options[i]) { 1211 return false 1212 } 1213 } 1214 if !this.SourceContext.Equal(that1.SourceContext) { 1215 return false 1216 } 1217 if this.Syntax != that1.Syntax { 1218 return false 1219 } 1220 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 1221 return false 1222 } 1223 return true 1224} 1225func (this *EnumValue) Equal(that interface{}) bool { 1226 if that == nil { 1227 return this == nil 1228 } 1229 1230 that1, ok := that.(*EnumValue) 1231 if !ok { 1232 that2, ok := that.(EnumValue) 1233 if ok { 1234 that1 = &that2 1235 } else { 1236 return false 1237 } 1238 } 1239 if that1 == nil { 1240 return this == nil 1241 } else if this == nil { 1242 return false 1243 } 1244 if this.Name != that1.Name { 1245 return false 1246 } 1247 if this.Number != that1.Number { 1248 return false 1249 } 1250 if len(this.Options) != len(that1.Options) { 1251 return false 1252 } 1253 for i := range this.Options { 1254 if !this.Options[i].Equal(that1.Options[i]) { 1255 return false 1256 } 1257 } 1258 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 1259 return false 1260 } 1261 return true 1262} 1263func (this *Option) Equal(that interface{}) bool { 1264 if that == nil { 1265 return this == nil 1266 } 1267 1268 that1, ok := that.(*Option) 1269 if !ok { 1270 that2, ok := that.(Option) 1271 if ok { 1272 that1 = &that2 1273 } else { 1274 return false 1275 } 1276 } 1277 if that1 == nil { 1278 return this == nil 1279 } else if this == nil { 1280 return false 1281 } 1282 if this.Name != that1.Name { 1283 return false 1284 } 1285 if !this.Value.Equal(that1.Value) { 1286 return false 1287 } 1288 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 1289 return false 1290 } 1291 return true 1292} 1293func (this *Type) GoString() string { 1294 if this == nil { 1295 return "nil" 1296 } 1297 s := make([]string, 0, 10) 1298 s = append(s, "&types.Type{") 1299 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 1300 if this.Fields != nil { 1301 s = append(s, "Fields: "+fmt.Sprintf("%#v", this.Fields)+",\n") 1302 } 1303 s = append(s, "Oneofs: "+fmt.Sprintf("%#v", this.Oneofs)+",\n") 1304 if this.Options != nil { 1305 s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") 1306 } 1307 if this.SourceContext != nil { 1308 s = append(s, "SourceContext: "+fmt.Sprintf("%#v", this.SourceContext)+",\n") 1309 } 1310 s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n") 1311 if this.XXX_unrecognized != nil { 1312 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 1313 } 1314 s = append(s, "}") 1315 return strings.Join(s, "") 1316} 1317func (this *Field) GoString() string { 1318 if this == nil { 1319 return "nil" 1320 } 1321 s := make([]string, 0, 14) 1322 s = append(s, "&types.Field{") 1323 s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\n") 1324 s = append(s, "Cardinality: "+fmt.Sprintf("%#v", this.Cardinality)+",\n") 1325 s = append(s, "Number: "+fmt.Sprintf("%#v", this.Number)+",\n") 1326 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 1327 s = append(s, "TypeUrl: "+fmt.Sprintf("%#v", this.TypeUrl)+",\n") 1328 s = append(s, "OneofIndex: "+fmt.Sprintf("%#v", this.OneofIndex)+",\n") 1329 s = append(s, "Packed: "+fmt.Sprintf("%#v", this.Packed)+",\n") 1330 if this.Options != nil { 1331 s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") 1332 } 1333 s = append(s, "JsonName: "+fmt.Sprintf("%#v", this.JsonName)+",\n") 1334 s = append(s, "DefaultValue: "+fmt.Sprintf("%#v", this.DefaultValue)+",\n") 1335 if this.XXX_unrecognized != nil { 1336 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 1337 } 1338 s = append(s, "}") 1339 return strings.Join(s, "") 1340} 1341func (this *Enum) GoString() string { 1342 if this == nil { 1343 return "nil" 1344 } 1345 s := make([]string, 0, 9) 1346 s = append(s, "&types.Enum{") 1347 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 1348 if this.Enumvalue != nil { 1349 s = append(s, "Enumvalue: "+fmt.Sprintf("%#v", this.Enumvalue)+",\n") 1350 } 1351 if this.Options != nil { 1352 s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") 1353 } 1354 if this.SourceContext != nil { 1355 s = append(s, "SourceContext: "+fmt.Sprintf("%#v", this.SourceContext)+",\n") 1356 } 1357 s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n") 1358 if this.XXX_unrecognized != nil { 1359 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 1360 } 1361 s = append(s, "}") 1362 return strings.Join(s, "") 1363} 1364func (this *EnumValue) GoString() string { 1365 if this == nil { 1366 return "nil" 1367 } 1368 s := make([]string, 0, 7) 1369 s = append(s, "&types.EnumValue{") 1370 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 1371 s = append(s, "Number: "+fmt.Sprintf("%#v", this.Number)+",\n") 1372 if this.Options != nil { 1373 s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") 1374 } 1375 if this.XXX_unrecognized != nil { 1376 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 1377 } 1378 s = append(s, "}") 1379 return strings.Join(s, "") 1380} 1381func (this *Option) GoString() string { 1382 if this == nil { 1383 return "nil" 1384 } 1385 s := make([]string, 0, 6) 1386 s = append(s, "&types.Option{") 1387 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 1388 if this.Value != nil { 1389 s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") 1390 } 1391 if this.XXX_unrecognized != nil { 1392 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 1393 } 1394 s = append(s, "}") 1395 return strings.Join(s, "") 1396} 1397func valueToGoStringType(v interface{}, typ string) string { 1398 rv := reflect.ValueOf(v) 1399 if rv.IsNil() { 1400 return "nil" 1401 } 1402 pv := reflect.Indirect(rv).Interface() 1403 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 1404} 1405func (m *Type) Marshal() (dAtA []byte, err error) { 1406 size := m.Size() 1407 dAtA = make([]byte, size) 1408 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1409 if err != nil { 1410 return nil, err 1411 } 1412 return dAtA[:n], nil 1413} 1414 1415func (m *Type) MarshalTo(dAtA []byte) (int, error) { 1416 size := m.Size() 1417 return m.MarshalToSizedBuffer(dAtA[:size]) 1418} 1419 1420func (m *Type) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1421 i := len(dAtA) 1422 _ = i 1423 var l int 1424 _ = l 1425 if m.XXX_unrecognized != nil { 1426 i -= len(m.XXX_unrecognized) 1427 copy(dAtA[i:], m.XXX_unrecognized) 1428 } 1429 if m.Syntax != 0 { 1430 i = encodeVarintType(dAtA, i, uint64(m.Syntax)) 1431 i-- 1432 dAtA[i] = 0x30 1433 } 1434 if m.SourceContext != nil { 1435 { 1436 size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i]) 1437 if err != nil { 1438 return 0, err 1439 } 1440 i -= size 1441 i = encodeVarintType(dAtA, i, uint64(size)) 1442 } 1443 i-- 1444 dAtA[i] = 0x2a 1445 } 1446 if len(m.Options) > 0 { 1447 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { 1448 { 1449 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1450 if err != nil { 1451 return 0, err 1452 } 1453 i -= size 1454 i = encodeVarintType(dAtA, i, uint64(size)) 1455 } 1456 i-- 1457 dAtA[i] = 0x22 1458 } 1459 } 1460 if len(m.Oneofs) > 0 { 1461 for iNdEx := len(m.Oneofs) - 1; iNdEx >= 0; iNdEx-- { 1462 i -= len(m.Oneofs[iNdEx]) 1463 copy(dAtA[i:], m.Oneofs[iNdEx]) 1464 i = encodeVarintType(dAtA, i, uint64(len(m.Oneofs[iNdEx]))) 1465 i-- 1466 dAtA[i] = 0x1a 1467 } 1468 } 1469 if len(m.Fields) > 0 { 1470 for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { 1471 { 1472 size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1473 if err != nil { 1474 return 0, err 1475 } 1476 i -= size 1477 i = encodeVarintType(dAtA, i, uint64(size)) 1478 } 1479 i-- 1480 dAtA[i] = 0x12 1481 } 1482 } 1483 if len(m.Name) > 0 { 1484 i -= len(m.Name) 1485 copy(dAtA[i:], m.Name) 1486 i = encodeVarintType(dAtA, i, uint64(len(m.Name))) 1487 i-- 1488 dAtA[i] = 0xa 1489 } 1490 return len(dAtA) - i, nil 1491} 1492 1493func (m *Field) Marshal() (dAtA []byte, err error) { 1494 size := m.Size() 1495 dAtA = make([]byte, size) 1496 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1497 if err != nil { 1498 return nil, err 1499 } 1500 return dAtA[:n], nil 1501} 1502 1503func (m *Field) MarshalTo(dAtA []byte) (int, error) { 1504 size := m.Size() 1505 return m.MarshalToSizedBuffer(dAtA[:size]) 1506} 1507 1508func (m *Field) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1509 i := len(dAtA) 1510 _ = i 1511 var l int 1512 _ = l 1513 if m.XXX_unrecognized != nil { 1514 i -= len(m.XXX_unrecognized) 1515 copy(dAtA[i:], m.XXX_unrecognized) 1516 } 1517 if len(m.DefaultValue) > 0 { 1518 i -= len(m.DefaultValue) 1519 copy(dAtA[i:], m.DefaultValue) 1520 i = encodeVarintType(dAtA, i, uint64(len(m.DefaultValue))) 1521 i-- 1522 dAtA[i] = 0x5a 1523 } 1524 if len(m.JsonName) > 0 { 1525 i -= len(m.JsonName) 1526 copy(dAtA[i:], m.JsonName) 1527 i = encodeVarintType(dAtA, i, uint64(len(m.JsonName))) 1528 i-- 1529 dAtA[i] = 0x52 1530 } 1531 if len(m.Options) > 0 { 1532 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { 1533 { 1534 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1535 if err != nil { 1536 return 0, err 1537 } 1538 i -= size 1539 i = encodeVarintType(dAtA, i, uint64(size)) 1540 } 1541 i-- 1542 dAtA[i] = 0x4a 1543 } 1544 } 1545 if m.Packed { 1546 i-- 1547 if m.Packed { 1548 dAtA[i] = 1 1549 } else { 1550 dAtA[i] = 0 1551 } 1552 i-- 1553 dAtA[i] = 0x40 1554 } 1555 if m.OneofIndex != 0 { 1556 i = encodeVarintType(dAtA, i, uint64(m.OneofIndex)) 1557 i-- 1558 dAtA[i] = 0x38 1559 } 1560 if len(m.TypeUrl) > 0 { 1561 i -= len(m.TypeUrl) 1562 copy(dAtA[i:], m.TypeUrl) 1563 i = encodeVarintType(dAtA, i, uint64(len(m.TypeUrl))) 1564 i-- 1565 dAtA[i] = 0x32 1566 } 1567 if len(m.Name) > 0 { 1568 i -= len(m.Name) 1569 copy(dAtA[i:], m.Name) 1570 i = encodeVarintType(dAtA, i, uint64(len(m.Name))) 1571 i-- 1572 dAtA[i] = 0x22 1573 } 1574 if m.Number != 0 { 1575 i = encodeVarintType(dAtA, i, uint64(m.Number)) 1576 i-- 1577 dAtA[i] = 0x18 1578 } 1579 if m.Cardinality != 0 { 1580 i = encodeVarintType(dAtA, i, uint64(m.Cardinality)) 1581 i-- 1582 dAtA[i] = 0x10 1583 } 1584 if m.Kind != 0 { 1585 i = encodeVarintType(dAtA, i, uint64(m.Kind)) 1586 i-- 1587 dAtA[i] = 0x8 1588 } 1589 return len(dAtA) - i, nil 1590} 1591 1592func (m *Enum) Marshal() (dAtA []byte, err error) { 1593 size := m.Size() 1594 dAtA = make([]byte, size) 1595 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1596 if err != nil { 1597 return nil, err 1598 } 1599 return dAtA[:n], nil 1600} 1601 1602func (m *Enum) MarshalTo(dAtA []byte) (int, error) { 1603 size := m.Size() 1604 return m.MarshalToSizedBuffer(dAtA[:size]) 1605} 1606 1607func (m *Enum) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1608 i := len(dAtA) 1609 _ = i 1610 var l int 1611 _ = l 1612 if m.XXX_unrecognized != nil { 1613 i -= len(m.XXX_unrecognized) 1614 copy(dAtA[i:], m.XXX_unrecognized) 1615 } 1616 if m.Syntax != 0 { 1617 i = encodeVarintType(dAtA, i, uint64(m.Syntax)) 1618 i-- 1619 dAtA[i] = 0x28 1620 } 1621 if m.SourceContext != nil { 1622 { 1623 size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i]) 1624 if err != nil { 1625 return 0, err 1626 } 1627 i -= size 1628 i = encodeVarintType(dAtA, i, uint64(size)) 1629 } 1630 i-- 1631 dAtA[i] = 0x22 1632 } 1633 if len(m.Options) > 0 { 1634 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { 1635 { 1636 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1637 if err != nil { 1638 return 0, err 1639 } 1640 i -= size 1641 i = encodeVarintType(dAtA, i, uint64(size)) 1642 } 1643 i-- 1644 dAtA[i] = 0x1a 1645 } 1646 } 1647 if len(m.Enumvalue) > 0 { 1648 for iNdEx := len(m.Enumvalue) - 1; iNdEx >= 0; iNdEx-- { 1649 { 1650 size, err := m.Enumvalue[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1651 if err != nil { 1652 return 0, err 1653 } 1654 i -= size 1655 i = encodeVarintType(dAtA, i, uint64(size)) 1656 } 1657 i-- 1658 dAtA[i] = 0x12 1659 } 1660 } 1661 if len(m.Name) > 0 { 1662 i -= len(m.Name) 1663 copy(dAtA[i:], m.Name) 1664 i = encodeVarintType(dAtA, i, uint64(len(m.Name))) 1665 i-- 1666 dAtA[i] = 0xa 1667 } 1668 return len(dAtA) - i, nil 1669} 1670 1671func (m *EnumValue) Marshal() (dAtA []byte, err error) { 1672 size := m.Size() 1673 dAtA = make([]byte, size) 1674 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1675 if err != nil { 1676 return nil, err 1677 } 1678 return dAtA[:n], nil 1679} 1680 1681func (m *EnumValue) MarshalTo(dAtA []byte) (int, error) { 1682 size := m.Size() 1683 return m.MarshalToSizedBuffer(dAtA[:size]) 1684} 1685 1686func (m *EnumValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1687 i := len(dAtA) 1688 _ = i 1689 var l int 1690 _ = l 1691 if m.XXX_unrecognized != nil { 1692 i -= len(m.XXX_unrecognized) 1693 copy(dAtA[i:], m.XXX_unrecognized) 1694 } 1695 if len(m.Options) > 0 { 1696 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { 1697 { 1698 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1699 if err != nil { 1700 return 0, err 1701 } 1702 i -= size 1703 i = encodeVarintType(dAtA, i, uint64(size)) 1704 } 1705 i-- 1706 dAtA[i] = 0x1a 1707 } 1708 } 1709 if m.Number != 0 { 1710 i = encodeVarintType(dAtA, i, uint64(m.Number)) 1711 i-- 1712 dAtA[i] = 0x10 1713 } 1714 if len(m.Name) > 0 { 1715 i -= len(m.Name) 1716 copy(dAtA[i:], m.Name) 1717 i = encodeVarintType(dAtA, i, uint64(len(m.Name))) 1718 i-- 1719 dAtA[i] = 0xa 1720 } 1721 return len(dAtA) - i, nil 1722} 1723 1724func (m *Option) Marshal() (dAtA []byte, err error) { 1725 size := m.Size() 1726 dAtA = make([]byte, size) 1727 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1728 if err != nil { 1729 return nil, err 1730 } 1731 return dAtA[:n], nil 1732} 1733 1734func (m *Option) MarshalTo(dAtA []byte) (int, error) { 1735 size := m.Size() 1736 return m.MarshalToSizedBuffer(dAtA[:size]) 1737} 1738 1739func (m *Option) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1740 i := len(dAtA) 1741 _ = i 1742 var l int 1743 _ = l 1744 if m.XXX_unrecognized != nil { 1745 i -= len(m.XXX_unrecognized) 1746 copy(dAtA[i:], m.XXX_unrecognized) 1747 } 1748 if m.Value != nil { 1749 { 1750 size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) 1751 if err != nil { 1752 return 0, err 1753 } 1754 i -= size 1755 i = encodeVarintType(dAtA, i, uint64(size)) 1756 } 1757 i-- 1758 dAtA[i] = 0x12 1759 } 1760 if len(m.Name) > 0 { 1761 i -= len(m.Name) 1762 copy(dAtA[i:], m.Name) 1763 i = encodeVarintType(dAtA, i, uint64(len(m.Name))) 1764 i-- 1765 dAtA[i] = 0xa 1766 } 1767 return len(dAtA) - i, nil 1768} 1769 1770func encodeVarintType(dAtA []byte, offset int, v uint64) int { 1771 offset -= sovType(v) 1772 base := offset 1773 for v >= 1<<7 { 1774 dAtA[offset] = uint8(v&0x7f | 0x80) 1775 v >>= 7 1776 offset++ 1777 } 1778 dAtA[offset] = uint8(v) 1779 return base 1780} 1781func NewPopulatedType(r randyType, easy bool) *Type { 1782 this := &Type{} 1783 this.Name = string(randStringType(r)) 1784 if r.Intn(5) != 0 { 1785 v1 := r.Intn(5) 1786 this.Fields = make([]*Field, v1) 1787 for i := 0; i < v1; i++ { 1788 this.Fields[i] = NewPopulatedField(r, easy) 1789 } 1790 } 1791 v2 := r.Intn(10) 1792 this.Oneofs = make([]string, v2) 1793 for i := 0; i < v2; i++ { 1794 this.Oneofs[i] = string(randStringType(r)) 1795 } 1796 if r.Intn(5) != 0 { 1797 v3 := r.Intn(5) 1798 this.Options = make([]*Option, v3) 1799 for i := 0; i < v3; i++ { 1800 this.Options[i] = NewPopulatedOption(r, easy) 1801 } 1802 } 1803 if r.Intn(5) != 0 { 1804 this.SourceContext = NewPopulatedSourceContext(r, easy) 1805 } 1806 this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)]) 1807 if !easy && r.Intn(10) != 0 { 1808 this.XXX_unrecognized = randUnrecognizedType(r, 7) 1809 } 1810 return this 1811} 1812 1813func NewPopulatedField(r randyType, easy bool) *Field { 1814 this := &Field{} 1815 this.Kind = Field_Kind([]int32{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}[r.Intn(19)]) 1816 this.Cardinality = Field_Cardinality([]int32{0, 1, 2, 3}[r.Intn(4)]) 1817 this.Number = int32(r.Int31()) 1818 if r.Intn(2) == 0 { 1819 this.Number *= -1 1820 } 1821 this.Name = string(randStringType(r)) 1822 this.TypeUrl = string(randStringType(r)) 1823 this.OneofIndex = int32(r.Int31()) 1824 if r.Intn(2) == 0 { 1825 this.OneofIndex *= -1 1826 } 1827 this.Packed = bool(bool(r.Intn(2) == 0)) 1828 if r.Intn(5) != 0 { 1829 v4 := r.Intn(5) 1830 this.Options = make([]*Option, v4) 1831 for i := 0; i < v4; i++ { 1832 this.Options[i] = NewPopulatedOption(r, easy) 1833 } 1834 } 1835 this.JsonName = string(randStringType(r)) 1836 this.DefaultValue = string(randStringType(r)) 1837 if !easy && r.Intn(10) != 0 { 1838 this.XXX_unrecognized = randUnrecognizedType(r, 12) 1839 } 1840 return this 1841} 1842 1843func NewPopulatedEnum(r randyType, easy bool) *Enum { 1844 this := &Enum{} 1845 this.Name = string(randStringType(r)) 1846 if r.Intn(5) != 0 { 1847 v5 := r.Intn(5) 1848 this.Enumvalue = make([]*EnumValue, v5) 1849 for i := 0; i < v5; i++ { 1850 this.Enumvalue[i] = NewPopulatedEnumValue(r, easy) 1851 } 1852 } 1853 if r.Intn(5) != 0 { 1854 v6 := r.Intn(5) 1855 this.Options = make([]*Option, v6) 1856 for i := 0; i < v6; i++ { 1857 this.Options[i] = NewPopulatedOption(r, easy) 1858 } 1859 } 1860 if r.Intn(5) != 0 { 1861 this.SourceContext = NewPopulatedSourceContext(r, easy) 1862 } 1863 this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)]) 1864 if !easy && r.Intn(10) != 0 { 1865 this.XXX_unrecognized = randUnrecognizedType(r, 6) 1866 } 1867 return this 1868} 1869 1870func NewPopulatedEnumValue(r randyType, easy bool) *EnumValue { 1871 this := &EnumValue{} 1872 this.Name = string(randStringType(r)) 1873 this.Number = int32(r.Int31()) 1874 if r.Intn(2) == 0 { 1875 this.Number *= -1 1876 } 1877 if r.Intn(5) != 0 { 1878 v7 := r.Intn(5) 1879 this.Options = make([]*Option, v7) 1880 for i := 0; i < v7; i++ { 1881 this.Options[i] = NewPopulatedOption(r, easy) 1882 } 1883 } 1884 if !easy && r.Intn(10) != 0 { 1885 this.XXX_unrecognized = randUnrecognizedType(r, 4) 1886 } 1887 return this 1888} 1889 1890func NewPopulatedOption(r randyType, easy bool) *Option { 1891 this := &Option{} 1892 this.Name = string(randStringType(r)) 1893 if r.Intn(5) != 0 { 1894 this.Value = NewPopulatedAny(r, easy) 1895 } 1896 if !easy && r.Intn(10) != 0 { 1897 this.XXX_unrecognized = randUnrecognizedType(r, 3) 1898 } 1899 return this 1900} 1901 1902type randyType interface { 1903 Float32() float32 1904 Float64() float64 1905 Int63() int64 1906 Int31() int32 1907 Uint32() uint32 1908 Intn(n int) int 1909} 1910 1911func randUTF8RuneType(r randyType) rune { 1912 ru := r.Intn(62) 1913 if ru < 10 { 1914 return rune(ru + 48) 1915 } else if ru < 36 { 1916 return rune(ru + 55) 1917 } 1918 return rune(ru + 61) 1919} 1920func randStringType(r randyType) string { 1921 v8 := r.Intn(100) 1922 tmps := make([]rune, v8) 1923 for i := 0; i < v8; i++ { 1924 tmps[i] = randUTF8RuneType(r) 1925 } 1926 return string(tmps) 1927} 1928func randUnrecognizedType(r randyType, maxFieldNumber int) (dAtA []byte) { 1929 l := r.Intn(5) 1930 for i := 0; i < l; i++ { 1931 wire := r.Intn(4) 1932 if wire == 3 { 1933 wire = 5 1934 } 1935 fieldNumber := maxFieldNumber + r.Intn(100) 1936 dAtA = randFieldType(dAtA, r, fieldNumber, wire) 1937 } 1938 return dAtA 1939} 1940func randFieldType(dAtA []byte, r randyType, fieldNumber int, wire int) []byte { 1941 key := uint32(fieldNumber)<<3 | uint32(wire) 1942 switch wire { 1943 case 0: 1944 dAtA = encodeVarintPopulateType(dAtA, uint64(key)) 1945 v9 := r.Int63() 1946 if r.Intn(2) == 0 { 1947 v9 *= -1 1948 } 1949 dAtA = encodeVarintPopulateType(dAtA, uint64(v9)) 1950 case 1: 1951 dAtA = encodeVarintPopulateType(dAtA, uint64(key)) 1952 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))) 1953 case 2: 1954 dAtA = encodeVarintPopulateType(dAtA, uint64(key)) 1955 ll := r.Intn(100) 1956 dAtA = encodeVarintPopulateType(dAtA, uint64(ll)) 1957 for j := 0; j < ll; j++ { 1958 dAtA = append(dAtA, byte(r.Intn(256))) 1959 } 1960 default: 1961 dAtA = encodeVarintPopulateType(dAtA, uint64(key)) 1962 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 1963 } 1964 return dAtA 1965} 1966func encodeVarintPopulateType(dAtA []byte, v uint64) []byte { 1967 for v >= 1<<7 { 1968 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) 1969 v >>= 7 1970 } 1971 dAtA = append(dAtA, uint8(v)) 1972 return dAtA 1973} 1974func (m *Type) Size() (n int) { 1975 if m == nil { 1976 return 0 1977 } 1978 var l int 1979 _ = l 1980 l = len(m.Name) 1981 if l > 0 { 1982 n += 1 + l + sovType(uint64(l)) 1983 } 1984 if len(m.Fields) > 0 { 1985 for _, e := range m.Fields { 1986 l = e.Size() 1987 n += 1 + l + sovType(uint64(l)) 1988 } 1989 } 1990 if len(m.Oneofs) > 0 { 1991 for _, s := range m.Oneofs { 1992 l = len(s) 1993 n += 1 + l + sovType(uint64(l)) 1994 } 1995 } 1996 if len(m.Options) > 0 { 1997 for _, e := range m.Options { 1998 l = e.Size() 1999 n += 1 + l + sovType(uint64(l)) 2000 } 2001 } 2002 if m.SourceContext != nil { 2003 l = m.SourceContext.Size() 2004 n += 1 + l + sovType(uint64(l)) 2005 } 2006 if m.Syntax != 0 { 2007 n += 1 + sovType(uint64(m.Syntax)) 2008 } 2009 if m.XXX_unrecognized != nil { 2010 n += len(m.XXX_unrecognized) 2011 } 2012 return n 2013} 2014 2015func (m *Field) Size() (n int) { 2016 if m == nil { 2017 return 0 2018 } 2019 var l int 2020 _ = l 2021 if m.Kind != 0 { 2022 n += 1 + sovType(uint64(m.Kind)) 2023 } 2024 if m.Cardinality != 0 { 2025 n += 1 + sovType(uint64(m.Cardinality)) 2026 } 2027 if m.Number != 0 { 2028 n += 1 + sovType(uint64(m.Number)) 2029 } 2030 l = len(m.Name) 2031 if l > 0 { 2032 n += 1 + l + sovType(uint64(l)) 2033 } 2034 l = len(m.TypeUrl) 2035 if l > 0 { 2036 n += 1 + l + sovType(uint64(l)) 2037 } 2038 if m.OneofIndex != 0 { 2039 n += 1 + sovType(uint64(m.OneofIndex)) 2040 } 2041 if m.Packed { 2042 n += 2 2043 } 2044 if len(m.Options) > 0 { 2045 for _, e := range m.Options { 2046 l = e.Size() 2047 n += 1 + l + sovType(uint64(l)) 2048 } 2049 } 2050 l = len(m.JsonName) 2051 if l > 0 { 2052 n += 1 + l + sovType(uint64(l)) 2053 } 2054 l = len(m.DefaultValue) 2055 if l > 0 { 2056 n += 1 + l + sovType(uint64(l)) 2057 } 2058 if m.XXX_unrecognized != nil { 2059 n += len(m.XXX_unrecognized) 2060 } 2061 return n 2062} 2063 2064func (m *Enum) Size() (n int) { 2065 if m == nil { 2066 return 0 2067 } 2068 var l int 2069 _ = l 2070 l = len(m.Name) 2071 if l > 0 { 2072 n += 1 + l + sovType(uint64(l)) 2073 } 2074 if len(m.Enumvalue) > 0 { 2075 for _, e := range m.Enumvalue { 2076 l = e.Size() 2077 n += 1 + l + sovType(uint64(l)) 2078 } 2079 } 2080 if len(m.Options) > 0 { 2081 for _, e := range m.Options { 2082 l = e.Size() 2083 n += 1 + l + sovType(uint64(l)) 2084 } 2085 } 2086 if m.SourceContext != nil { 2087 l = m.SourceContext.Size() 2088 n += 1 + l + sovType(uint64(l)) 2089 } 2090 if m.Syntax != 0 { 2091 n += 1 + sovType(uint64(m.Syntax)) 2092 } 2093 if m.XXX_unrecognized != nil { 2094 n += len(m.XXX_unrecognized) 2095 } 2096 return n 2097} 2098 2099func (m *EnumValue) Size() (n int) { 2100 if m == nil { 2101 return 0 2102 } 2103 var l int 2104 _ = l 2105 l = len(m.Name) 2106 if l > 0 { 2107 n += 1 + l + sovType(uint64(l)) 2108 } 2109 if m.Number != 0 { 2110 n += 1 + sovType(uint64(m.Number)) 2111 } 2112 if len(m.Options) > 0 { 2113 for _, e := range m.Options { 2114 l = e.Size() 2115 n += 1 + l + sovType(uint64(l)) 2116 } 2117 } 2118 if m.XXX_unrecognized != nil { 2119 n += len(m.XXX_unrecognized) 2120 } 2121 return n 2122} 2123 2124func (m *Option) Size() (n int) { 2125 if m == nil { 2126 return 0 2127 } 2128 var l int 2129 _ = l 2130 l = len(m.Name) 2131 if l > 0 { 2132 n += 1 + l + sovType(uint64(l)) 2133 } 2134 if m.Value != nil { 2135 l = m.Value.Size() 2136 n += 1 + l + sovType(uint64(l)) 2137 } 2138 if m.XXX_unrecognized != nil { 2139 n += len(m.XXX_unrecognized) 2140 } 2141 return n 2142} 2143 2144func sovType(x uint64) (n int) { 2145 return (math_bits.Len64(x|1) + 6) / 7 2146} 2147func sozType(x uint64) (n int) { 2148 return sovType(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 2149} 2150func (this *Type) String() string { 2151 if this == nil { 2152 return "nil" 2153 } 2154 repeatedStringForFields := "[]*Field{" 2155 for _, f := range this.Fields { 2156 repeatedStringForFields += strings.Replace(f.String(), "Field", "Field", 1) + "," 2157 } 2158 repeatedStringForFields += "}" 2159 repeatedStringForOptions := "[]*Option{" 2160 for _, f := range this.Options { 2161 repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + "," 2162 } 2163 repeatedStringForOptions += "}" 2164 s := strings.Join([]string{`&Type{`, 2165 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 2166 `Fields:` + repeatedStringForFields + `,`, 2167 `Oneofs:` + fmt.Sprintf("%v", this.Oneofs) + `,`, 2168 `Options:` + repeatedStringForOptions + `,`, 2169 `SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`, 2170 `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`, 2171 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 2172 `}`, 2173 }, "") 2174 return s 2175} 2176func (this *Field) String() string { 2177 if this == nil { 2178 return "nil" 2179 } 2180 repeatedStringForOptions := "[]*Option{" 2181 for _, f := range this.Options { 2182 repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + "," 2183 } 2184 repeatedStringForOptions += "}" 2185 s := strings.Join([]string{`&Field{`, 2186 `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, 2187 `Cardinality:` + fmt.Sprintf("%v", this.Cardinality) + `,`, 2188 `Number:` + fmt.Sprintf("%v", this.Number) + `,`, 2189 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 2190 `TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`, 2191 `OneofIndex:` + fmt.Sprintf("%v", this.OneofIndex) + `,`, 2192 `Packed:` + fmt.Sprintf("%v", this.Packed) + `,`, 2193 `Options:` + repeatedStringForOptions + `,`, 2194 `JsonName:` + fmt.Sprintf("%v", this.JsonName) + `,`, 2195 `DefaultValue:` + fmt.Sprintf("%v", this.DefaultValue) + `,`, 2196 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 2197 `}`, 2198 }, "") 2199 return s 2200} 2201func (this *Enum) String() string { 2202 if this == nil { 2203 return "nil" 2204 } 2205 repeatedStringForEnumvalue := "[]*EnumValue{" 2206 for _, f := range this.Enumvalue { 2207 repeatedStringForEnumvalue += strings.Replace(f.String(), "EnumValue", "EnumValue", 1) + "," 2208 } 2209 repeatedStringForEnumvalue += "}" 2210 repeatedStringForOptions := "[]*Option{" 2211 for _, f := range this.Options { 2212 repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + "," 2213 } 2214 repeatedStringForOptions += "}" 2215 s := strings.Join([]string{`&Enum{`, 2216 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 2217 `Enumvalue:` + repeatedStringForEnumvalue + `,`, 2218 `Options:` + repeatedStringForOptions + `,`, 2219 `SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`, 2220 `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`, 2221 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 2222 `}`, 2223 }, "") 2224 return s 2225} 2226func (this *EnumValue) String() string { 2227 if this == nil { 2228 return "nil" 2229 } 2230 repeatedStringForOptions := "[]*Option{" 2231 for _, f := range this.Options { 2232 repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + "," 2233 } 2234 repeatedStringForOptions += "}" 2235 s := strings.Join([]string{`&EnumValue{`, 2236 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 2237 `Number:` + fmt.Sprintf("%v", this.Number) + `,`, 2238 `Options:` + repeatedStringForOptions + `,`, 2239 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 2240 `}`, 2241 }, "") 2242 return s 2243} 2244func (this *Option) String() string { 2245 if this == nil { 2246 return "nil" 2247 } 2248 s := strings.Join([]string{`&Option{`, 2249 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 2250 `Value:` + strings.Replace(fmt.Sprintf("%v", this.Value), "Any", "Any", 1) + `,`, 2251 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 2252 `}`, 2253 }, "") 2254 return s 2255} 2256func valueToStringType(v interface{}) string { 2257 rv := reflect.ValueOf(v) 2258 if rv.IsNil() { 2259 return "nil" 2260 } 2261 pv := reflect.Indirect(rv).Interface() 2262 return fmt.Sprintf("*%v", pv) 2263} 2264func (m *Type) Unmarshal(dAtA []byte) error { 2265 l := len(dAtA) 2266 iNdEx := 0 2267 for iNdEx < l { 2268 preIndex := iNdEx 2269 var wire uint64 2270 for shift := uint(0); ; shift += 7 { 2271 if shift >= 64 { 2272 return ErrIntOverflowType 2273 } 2274 if iNdEx >= l { 2275 return io.ErrUnexpectedEOF 2276 } 2277 b := dAtA[iNdEx] 2278 iNdEx++ 2279 wire |= uint64(b&0x7F) << shift 2280 if b < 0x80 { 2281 break 2282 } 2283 } 2284 fieldNum := int32(wire >> 3) 2285 wireType := int(wire & 0x7) 2286 if wireType == 4 { 2287 return fmt.Errorf("proto: Type: wiretype end group for non-group") 2288 } 2289 if fieldNum <= 0 { 2290 return fmt.Errorf("proto: Type: illegal tag %d (wire type %d)", fieldNum, wire) 2291 } 2292 switch fieldNum { 2293 case 1: 2294 if wireType != 2 { 2295 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 2296 } 2297 var stringLen uint64 2298 for shift := uint(0); ; shift += 7 { 2299 if shift >= 64 { 2300 return ErrIntOverflowType 2301 } 2302 if iNdEx >= l { 2303 return io.ErrUnexpectedEOF 2304 } 2305 b := dAtA[iNdEx] 2306 iNdEx++ 2307 stringLen |= uint64(b&0x7F) << shift 2308 if b < 0x80 { 2309 break 2310 } 2311 } 2312 intStringLen := int(stringLen) 2313 if intStringLen < 0 { 2314 return ErrInvalidLengthType 2315 } 2316 postIndex := iNdEx + intStringLen 2317 if postIndex < 0 { 2318 return ErrInvalidLengthType 2319 } 2320 if postIndex > l { 2321 return io.ErrUnexpectedEOF 2322 } 2323 m.Name = string(dAtA[iNdEx:postIndex]) 2324 iNdEx = postIndex 2325 case 2: 2326 if wireType != 2 { 2327 return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) 2328 } 2329 var msglen int 2330 for shift := uint(0); ; shift += 7 { 2331 if shift >= 64 { 2332 return ErrIntOverflowType 2333 } 2334 if iNdEx >= l { 2335 return io.ErrUnexpectedEOF 2336 } 2337 b := dAtA[iNdEx] 2338 iNdEx++ 2339 msglen |= int(b&0x7F) << shift 2340 if b < 0x80 { 2341 break 2342 } 2343 } 2344 if msglen < 0 { 2345 return ErrInvalidLengthType 2346 } 2347 postIndex := iNdEx + msglen 2348 if postIndex < 0 { 2349 return ErrInvalidLengthType 2350 } 2351 if postIndex > l { 2352 return io.ErrUnexpectedEOF 2353 } 2354 m.Fields = append(m.Fields, &Field{}) 2355 if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2356 return err 2357 } 2358 iNdEx = postIndex 2359 case 3: 2360 if wireType != 2 { 2361 return fmt.Errorf("proto: wrong wireType = %d for field Oneofs", wireType) 2362 } 2363 var stringLen uint64 2364 for shift := uint(0); ; shift += 7 { 2365 if shift >= 64 { 2366 return ErrIntOverflowType 2367 } 2368 if iNdEx >= l { 2369 return io.ErrUnexpectedEOF 2370 } 2371 b := dAtA[iNdEx] 2372 iNdEx++ 2373 stringLen |= uint64(b&0x7F) << shift 2374 if b < 0x80 { 2375 break 2376 } 2377 } 2378 intStringLen := int(stringLen) 2379 if intStringLen < 0 { 2380 return ErrInvalidLengthType 2381 } 2382 postIndex := iNdEx + intStringLen 2383 if postIndex < 0 { 2384 return ErrInvalidLengthType 2385 } 2386 if postIndex > l { 2387 return io.ErrUnexpectedEOF 2388 } 2389 m.Oneofs = append(m.Oneofs, string(dAtA[iNdEx:postIndex])) 2390 iNdEx = postIndex 2391 case 4: 2392 if wireType != 2 { 2393 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) 2394 } 2395 var msglen int 2396 for shift := uint(0); ; shift += 7 { 2397 if shift >= 64 { 2398 return ErrIntOverflowType 2399 } 2400 if iNdEx >= l { 2401 return io.ErrUnexpectedEOF 2402 } 2403 b := dAtA[iNdEx] 2404 iNdEx++ 2405 msglen |= int(b&0x7F) << shift 2406 if b < 0x80 { 2407 break 2408 } 2409 } 2410 if msglen < 0 { 2411 return ErrInvalidLengthType 2412 } 2413 postIndex := iNdEx + msglen 2414 if postIndex < 0 { 2415 return ErrInvalidLengthType 2416 } 2417 if postIndex > l { 2418 return io.ErrUnexpectedEOF 2419 } 2420 m.Options = append(m.Options, &Option{}) 2421 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2422 return err 2423 } 2424 iNdEx = postIndex 2425 case 5: 2426 if wireType != 2 { 2427 return fmt.Errorf("proto: wrong wireType = %d for field SourceContext", wireType) 2428 } 2429 var msglen int 2430 for shift := uint(0); ; shift += 7 { 2431 if shift >= 64 { 2432 return ErrIntOverflowType 2433 } 2434 if iNdEx >= l { 2435 return io.ErrUnexpectedEOF 2436 } 2437 b := dAtA[iNdEx] 2438 iNdEx++ 2439 msglen |= int(b&0x7F) << shift 2440 if b < 0x80 { 2441 break 2442 } 2443 } 2444 if msglen < 0 { 2445 return ErrInvalidLengthType 2446 } 2447 postIndex := iNdEx + msglen 2448 if postIndex < 0 { 2449 return ErrInvalidLengthType 2450 } 2451 if postIndex > l { 2452 return io.ErrUnexpectedEOF 2453 } 2454 if m.SourceContext == nil { 2455 m.SourceContext = &SourceContext{} 2456 } 2457 if err := m.SourceContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2458 return err 2459 } 2460 iNdEx = postIndex 2461 case 6: 2462 if wireType != 0 { 2463 return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType) 2464 } 2465 m.Syntax = 0 2466 for shift := uint(0); ; shift += 7 { 2467 if shift >= 64 { 2468 return ErrIntOverflowType 2469 } 2470 if iNdEx >= l { 2471 return io.ErrUnexpectedEOF 2472 } 2473 b := dAtA[iNdEx] 2474 iNdEx++ 2475 m.Syntax |= Syntax(b&0x7F) << shift 2476 if b < 0x80 { 2477 break 2478 } 2479 } 2480 default: 2481 iNdEx = preIndex 2482 skippy, err := skipType(dAtA[iNdEx:]) 2483 if err != nil { 2484 return err 2485 } 2486 if skippy < 0 { 2487 return ErrInvalidLengthType 2488 } 2489 if (iNdEx + skippy) < 0 { 2490 return ErrInvalidLengthType 2491 } 2492 if (iNdEx + skippy) > l { 2493 return io.ErrUnexpectedEOF 2494 } 2495 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 2496 iNdEx += skippy 2497 } 2498 } 2499 2500 if iNdEx > l { 2501 return io.ErrUnexpectedEOF 2502 } 2503 return nil 2504} 2505func (m *Field) Unmarshal(dAtA []byte) error { 2506 l := len(dAtA) 2507 iNdEx := 0 2508 for iNdEx < l { 2509 preIndex := iNdEx 2510 var wire uint64 2511 for shift := uint(0); ; shift += 7 { 2512 if shift >= 64 { 2513 return ErrIntOverflowType 2514 } 2515 if iNdEx >= l { 2516 return io.ErrUnexpectedEOF 2517 } 2518 b := dAtA[iNdEx] 2519 iNdEx++ 2520 wire |= uint64(b&0x7F) << shift 2521 if b < 0x80 { 2522 break 2523 } 2524 } 2525 fieldNum := int32(wire >> 3) 2526 wireType := int(wire & 0x7) 2527 if wireType == 4 { 2528 return fmt.Errorf("proto: Field: wiretype end group for non-group") 2529 } 2530 if fieldNum <= 0 { 2531 return fmt.Errorf("proto: Field: illegal tag %d (wire type %d)", fieldNum, wire) 2532 } 2533 switch fieldNum { 2534 case 1: 2535 if wireType != 0 { 2536 return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) 2537 } 2538 m.Kind = 0 2539 for shift := uint(0); ; shift += 7 { 2540 if shift >= 64 { 2541 return ErrIntOverflowType 2542 } 2543 if iNdEx >= l { 2544 return io.ErrUnexpectedEOF 2545 } 2546 b := dAtA[iNdEx] 2547 iNdEx++ 2548 m.Kind |= Field_Kind(b&0x7F) << shift 2549 if b < 0x80 { 2550 break 2551 } 2552 } 2553 case 2: 2554 if wireType != 0 { 2555 return fmt.Errorf("proto: wrong wireType = %d for field Cardinality", wireType) 2556 } 2557 m.Cardinality = 0 2558 for shift := uint(0); ; shift += 7 { 2559 if shift >= 64 { 2560 return ErrIntOverflowType 2561 } 2562 if iNdEx >= l { 2563 return io.ErrUnexpectedEOF 2564 } 2565 b := dAtA[iNdEx] 2566 iNdEx++ 2567 m.Cardinality |= Field_Cardinality(b&0x7F) << shift 2568 if b < 0x80 { 2569 break 2570 } 2571 } 2572 case 3: 2573 if wireType != 0 { 2574 return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) 2575 } 2576 m.Number = 0 2577 for shift := uint(0); ; shift += 7 { 2578 if shift >= 64 { 2579 return ErrIntOverflowType 2580 } 2581 if iNdEx >= l { 2582 return io.ErrUnexpectedEOF 2583 } 2584 b := dAtA[iNdEx] 2585 iNdEx++ 2586 m.Number |= int32(b&0x7F) << shift 2587 if b < 0x80 { 2588 break 2589 } 2590 } 2591 case 4: 2592 if wireType != 2 { 2593 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 2594 } 2595 var stringLen uint64 2596 for shift := uint(0); ; shift += 7 { 2597 if shift >= 64 { 2598 return ErrIntOverflowType 2599 } 2600 if iNdEx >= l { 2601 return io.ErrUnexpectedEOF 2602 } 2603 b := dAtA[iNdEx] 2604 iNdEx++ 2605 stringLen |= uint64(b&0x7F) << shift 2606 if b < 0x80 { 2607 break 2608 } 2609 } 2610 intStringLen := int(stringLen) 2611 if intStringLen < 0 { 2612 return ErrInvalidLengthType 2613 } 2614 postIndex := iNdEx + intStringLen 2615 if postIndex < 0 { 2616 return ErrInvalidLengthType 2617 } 2618 if postIndex > l { 2619 return io.ErrUnexpectedEOF 2620 } 2621 m.Name = string(dAtA[iNdEx:postIndex]) 2622 iNdEx = postIndex 2623 case 6: 2624 if wireType != 2 { 2625 return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) 2626 } 2627 var stringLen uint64 2628 for shift := uint(0); ; shift += 7 { 2629 if shift >= 64 { 2630 return ErrIntOverflowType 2631 } 2632 if iNdEx >= l { 2633 return io.ErrUnexpectedEOF 2634 } 2635 b := dAtA[iNdEx] 2636 iNdEx++ 2637 stringLen |= uint64(b&0x7F) << shift 2638 if b < 0x80 { 2639 break 2640 } 2641 } 2642 intStringLen := int(stringLen) 2643 if intStringLen < 0 { 2644 return ErrInvalidLengthType 2645 } 2646 postIndex := iNdEx + intStringLen 2647 if postIndex < 0 { 2648 return ErrInvalidLengthType 2649 } 2650 if postIndex > l { 2651 return io.ErrUnexpectedEOF 2652 } 2653 m.TypeUrl = string(dAtA[iNdEx:postIndex]) 2654 iNdEx = postIndex 2655 case 7: 2656 if wireType != 0 { 2657 return fmt.Errorf("proto: wrong wireType = %d for field OneofIndex", wireType) 2658 } 2659 m.OneofIndex = 0 2660 for shift := uint(0); ; shift += 7 { 2661 if shift >= 64 { 2662 return ErrIntOverflowType 2663 } 2664 if iNdEx >= l { 2665 return io.ErrUnexpectedEOF 2666 } 2667 b := dAtA[iNdEx] 2668 iNdEx++ 2669 m.OneofIndex |= int32(b&0x7F) << shift 2670 if b < 0x80 { 2671 break 2672 } 2673 } 2674 case 8: 2675 if wireType != 0 { 2676 return fmt.Errorf("proto: wrong wireType = %d for field Packed", wireType) 2677 } 2678 var v int 2679 for shift := uint(0); ; shift += 7 { 2680 if shift >= 64 { 2681 return ErrIntOverflowType 2682 } 2683 if iNdEx >= l { 2684 return io.ErrUnexpectedEOF 2685 } 2686 b := dAtA[iNdEx] 2687 iNdEx++ 2688 v |= int(b&0x7F) << shift 2689 if b < 0x80 { 2690 break 2691 } 2692 } 2693 m.Packed = bool(v != 0) 2694 case 9: 2695 if wireType != 2 { 2696 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) 2697 } 2698 var msglen int 2699 for shift := uint(0); ; shift += 7 { 2700 if shift >= 64 { 2701 return ErrIntOverflowType 2702 } 2703 if iNdEx >= l { 2704 return io.ErrUnexpectedEOF 2705 } 2706 b := dAtA[iNdEx] 2707 iNdEx++ 2708 msglen |= int(b&0x7F) << shift 2709 if b < 0x80 { 2710 break 2711 } 2712 } 2713 if msglen < 0 { 2714 return ErrInvalidLengthType 2715 } 2716 postIndex := iNdEx + msglen 2717 if postIndex < 0 { 2718 return ErrInvalidLengthType 2719 } 2720 if postIndex > l { 2721 return io.ErrUnexpectedEOF 2722 } 2723 m.Options = append(m.Options, &Option{}) 2724 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2725 return err 2726 } 2727 iNdEx = postIndex 2728 case 10: 2729 if wireType != 2 { 2730 return fmt.Errorf("proto: wrong wireType = %d for field JsonName", wireType) 2731 } 2732 var stringLen uint64 2733 for shift := uint(0); ; shift += 7 { 2734 if shift >= 64 { 2735 return ErrIntOverflowType 2736 } 2737 if iNdEx >= l { 2738 return io.ErrUnexpectedEOF 2739 } 2740 b := dAtA[iNdEx] 2741 iNdEx++ 2742 stringLen |= uint64(b&0x7F) << shift 2743 if b < 0x80 { 2744 break 2745 } 2746 } 2747 intStringLen := int(stringLen) 2748 if intStringLen < 0 { 2749 return ErrInvalidLengthType 2750 } 2751 postIndex := iNdEx + intStringLen 2752 if postIndex < 0 { 2753 return ErrInvalidLengthType 2754 } 2755 if postIndex > l { 2756 return io.ErrUnexpectedEOF 2757 } 2758 m.JsonName = string(dAtA[iNdEx:postIndex]) 2759 iNdEx = postIndex 2760 case 11: 2761 if wireType != 2 { 2762 return fmt.Errorf("proto: wrong wireType = %d for field DefaultValue", wireType) 2763 } 2764 var stringLen uint64 2765 for shift := uint(0); ; shift += 7 { 2766 if shift >= 64 { 2767 return ErrIntOverflowType 2768 } 2769 if iNdEx >= l { 2770 return io.ErrUnexpectedEOF 2771 } 2772 b := dAtA[iNdEx] 2773 iNdEx++ 2774 stringLen |= uint64(b&0x7F) << shift 2775 if b < 0x80 { 2776 break 2777 } 2778 } 2779 intStringLen := int(stringLen) 2780 if intStringLen < 0 { 2781 return ErrInvalidLengthType 2782 } 2783 postIndex := iNdEx + intStringLen 2784 if postIndex < 0 { 2785 return ErrInvalidLengthType 2786 } 2787 if postIndex > l { 2788 return io.ErrUnexpectedEOF 2789 } 2790 m.DefaultValue = string(dAtA[iNdEx:postIndex]) 2791 iNdEx = postIndex 2792 default: 2793 iNdEx = preIndex 2794 skippy, err := skipType(dAtA[iNdEx:]) 2795 if err != nil { 2796 return err 2797 } 2798 if skippy < 0 { 2799 return ErrInvalidLengthType 2800 } 2801 if (iNdEx + skippy) < 0 { 2802 return ErrInvalidLengthType 2803 } 2804 if (iNdEx + skippy) > l { 2805 return io.ErrUnexpectedEOF 2806 } 2807 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 2808 iNdEx += skippy 2809 } 2810 } 2811 2812 if iNdEx > l { 2813 return io.ErrUnexpectedEOF 2814 } 2815 return nil 2816} 2817func (m *Enum) Unmarshal(dAtA []byte) error { 2818 l := len(dAtA) 2819 iNdEx := 0 2820 for iNdEx < l { 2821 preIndex := iNdEx 2822 var wire uint64 2823 for shift := uint(0); ; shift += 7 { 2824 if shift >= 64 { 2825 return ErrIntOverflowType 2826 } 2827 if iNdEx >= l { 2828 return io.ErrUnexpectedEOF 2829 } 2830 b := dAtA[iNdEx] 2831 iNdEx++ 2832 wire |= uint64(b&0x7F) << shift 2833 if b < 0x80 { 2834 break 2835 } 2836 } 2837 fieldNum := int32(wire >> 3) 2838 wireType := int(wire & 0x7) 2839 if wireType == 4 { 2840 return fmt.Errorf("proto: Enum: wiretype end group for non-group") 2841 } 2842 if fieldNum <= 0 { 2843 return fmt.Errorf("proto: Enum: illegal tag %d (wire type %d)", fieldNum, wire) 2844 } 2845 switch fieldNum { 2846 case 1: 2847 if wireType != 2 { 2848 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 2849 } 2850 var stringLen uint64 2851 for shift := uint(0); ; shift += 7 { 2852 if shift >= 64 { 2853 return ErrIntOverflowType 2854 } 2855 if iNdEx >= l { 2856 return io.ErrUnexpectedEOF 2857 } 2858 b := dAtA[iNdEx] 2859 iNdEx++ 2860 stringLen |= uint64(b&0x7F) << shift 2861 if b < 0x80 { 2862 break 2863 } 2864 } 2865 intStringLen := int(stringLen) 2866 if intStringLen < 0 { 2867 return ErrInvalidLengthType 2868 } 2869 postIndex := iNdEx + intStringLen 2870 if postIndex < 0 { 2871 return ErrInvalidLengthType 2872 } 2873 if postIndex > l { 2874 return io.ErrUnexpectedEOF 2875 } 2876 m.Name = string(dAtA[iNdEx:postIndex]) 2877 iNdEx = postIndex 2878 case 2: 2879 if wireType != 2 { 2880 return fmt.Errorf("proto: wrong wireType = %d for field Enumvalue", wireType) 2881 } 2882 var msglen int 2883 for shift := uint(0); ; shift += 7 { 2884 if shift >= 64 { 2885 return ErrIntOverflowType 2886 } 2887 if iNdEx >= l { 2888 return io.ErrUnexpectedEOF 2889 } 2890 b := dAtA[iNdEx] 2891 iNdEx++ 2892 msglen |= int(b&0x7F) << shift 2893 if b < 0x80 { 2894 break 2895 } 2896 } 2897 if msglen < 0 { 2898 return ErrInvalidLengthType 2899 } 2900 postIndex := iNdEx + msglen 2901 if postIndex < 0 { 2902 return ErrInvalidLengthType 2903 } 2904 if postIndex > l { 2905 return io.ErrUnexpectedEOF 2906 } 2907 m.Enumvalue = append(m.Enumvalue, &EnumValue{}) 2908 if err := m.Enumvalue[len(m.Enumvalue)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2909 return err 2910 } 2911 iNdEx = postIndex 2912 case 3: 2913 if wireType != 2 { 2914 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) 2915 } 2916 var msglen int 2917 for shift := uint(0); ; shift += 7 { 2918 if shift >= 64 { 2919 return ErrIntOverflowType 2920 } 2921 if iNdEx >= l { 2922 return io.ErrUnexpectedEOF 2923 } 2924 b := dAtA[iNdEx] 2925 iNdEx++ 2926 msglen |= int(b&0x7F) << shift 2927 if b < 0x80 { 2928 break 2929 } 2930 } 2931 if msglen < 0 { 2932 return ErrInvalidLengthType 2933 } 2934 postIndex := iNdEx + msglen 2935 if postIndex < 0 { 2936 return ErrInvalidLengthType 2937 } 2938 if postIndex > l { 2939 return io.ErrUnexpectedEOF 2940 } 2941 m.Options = append(m.Options, &Option{}) 2942 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2943 return err 2944 } 2945 iNdEx = postIndex 2946 case 4: 2947 if wireType != 2 { 2948 return fmt.Errorf("proto: wrong wireType = %d for field SourceContext", wireType) 2949 } 2950 var msglen int 2951 for shift := uint(0); ; shift += 7 { 2952 if shift >= 64 { 2953 return ErrIntOverflowType 2954 } 2955 if iNdEx >= l { 2956 return io.ErrUnexpectedEOF 2957 } 2958 b := dAtA[iNdEx] 2959 iNdEx++ 2960 msglen |= int(b&0x7F) << shift 2961 if b < 0x80 { 2962 break 2963 } 2964 } 2965 if msglen < 0 { 2966 return ErrInvalidLengthType 2967 } 2968 postIndex := iNdEx + msglen 2969 if postIndex < 0 { 2970 return ErrInvalidLengthType 2971 } 2972 if postIndex > l { 2973 return io.ErrUnexpectedEOF 2974 } 2975 if m.SourceContext == nil { 2976 m.SourceContext = &SourceContext{} 2977 } 2978 if err := m.SourceContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2979 return err 2980 } 2981 iNdEx = postIndex 2982 case 5: 2983 if wireType != 0 { 2984 return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType) 2985 } 2986 m.Syntax = 0 2987 for shift := uint(0); ; shift += 7 { 2988 if shift >= 64 { 2989 return ErrIntOverflowType 2990 } 2991 if iNdEx >= l { 2992 return io.ErrUnexpectedEOF 2993 } 2994 b := dAtA[iNdEx] 2995 iNdEx++ 2996 m.Syntax |= Syntax(b&0x7F) << shift 2997 if b < 0x80 { 2998 break 2999 } 3000 } 3001 default: 3002 iNdEx = preIndex 3003 skippy, err := skipType(dAtA[iNdEx:]) 3004 if err != nil { 3005 return err 3006 } 3007 if skippy < 0 { 3008 return ErrInvalidLengthType 3009 } 3010 if (iNdEx + skippy) < 0 { 3011 return ErrInvalidLengthType 3012 } 3013 if (iNdEx + skippy) > l { 3014 return io.ErrUnexpectedEOF 3015 } 3016 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 3017 iNdEx += skippy 3018 } 3019 } 3020 3021 if iNdEx > l { 3022 return io.ErrUnexpectedEOF 3023 } 3024 return nil 3025} 3026func (m *EnumValue) Unmarshal(dAtA []byte) error { 3027 l := len(dAtA) 3028 iNdEx := 0 3029 for iNdEx < l { 3030 preIndex := iNdEx 3031 var wire uint64 3032 for shift := uint(0); ; shift += 7 { 3033 if shift >= 64 { 3034 return ErrIntOverflowType 3035 } 3036 if iNdEx >= l { 3037 return io.ErrUnexpectedEOF 3038 } 3039 b := dAtA[iNdEx] 3040 iNdEx++ 3041 wire |= uint64(b&0x7F) << shift 3042 if b < 0x80 { 3043 break 3044 } 3045 } 3046 fieldNum := int32(wire >> 3) 3047 wireType := int(wire & 0x7) 3048 if wireType == 4 { 3049 return fmt.Errorf("proto: EnumValue: wiretype end group for non-group") 3050 } 3051 if fieldNum <= 0 { 3052 return fmt.Errorf("proto: EnumValue: illegal tag %d (wire type %d)", fieldNum, wire) 3053 } 3054 switch fieldNum { 3055 case 1: 3056 if wireType != 2 { 3057 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 3058 } 3059 var stringLen uint64 3060 for shift := uint(0); ; shift += 7 { 3061 if shift >= 64 { 3062 return ErrIntOverflowType 3063 } 3064 if iNdEx >= l { 3065 return io.ErrUnexpectedEOF 3066 } 3067 b := dAtA[iNdEx] 3068 iNdEx++ 3069 stringLen |= uint64(b&0x7F) << shift 3070 if b < 0x80 { 3071 break 3072 } 3073 } 3074 intStringLen := int(stringLen) 3075 if intStringLen < 0 { 3076 return ErrInvalidLengthType 3077 } 3078 postIndex := iNdEx + intStringLen 3079 if postIndex < 0 { 3080 return ErrInvalidLengthType 3081 } 3082 if postIndex > l { 3083 return io.ErrUnexpectedEOF 3084 } 3085 m.Name = string(dAtA[iNdEx:postIndex]) 3086 iNdEx = postIndex 3087 case 2: 3088 if wireType != 0 { 3089 return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) 3090 } 3091 m.Number = 0 3092 for shift := uint(0); ; shift += 7 { 3093 if shift >= 64 { 3094 return ErrIntOverflowType 3095 } 3096 if iNdEx >= l { 3097 return io.ErrUnexpectedEOF 3098 } 3099 b := dAtA[iNdEx] 3100 iNdEx++ 3101 m.Number |= int32(b&0x7F) << shift 3102 if b < 0x80 { 3103 break 3104 } 3105 } 3106 case 3: 3107 if wireType != 2 { 3108 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) 3109 } 3110 var msglen int 3111 for shift := uint(0); ; shift += 7 { 3112 if shift >= 64 { 3113 return ErrIntOverflowType 3114 } 3115 if iNdEx >= l { 3116 return io.ErrUnexpectedEOF 3117 } 3118 b := dAtA[iNdEx] 3119 iNdEx++ 3120 msglen |= int(b&0x7F) << shift 3121 if b < 0x80 { 3122 break 3123 } 3124 } 3125 if msglen < 0 { 3126 return ErrInvalidLengthType 3127 } 3128 postIndex := iNdEx + msglen 3129 if postIndex < 0 { 3130 return ErrInvalidLengthType 3131 } 3132 if postIndex > l { 3133 return io.ErrUnexpectedEOF 3134 } 3135 m.Options = append(m.Options, &Option{}) 3136 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 3137 return err 3138 } 3139 iNdEx = postIndex 3140 default: 3141 iNdEx = preIndex 3142 skippy, err := skipType(dAtA[iNdEx:]) 3143 if err != nil { 3144 return err 3145 } 3146 if skippy < 0 { 3147 return ErrInvalidLengthType 3148 } 3149 if (iNdEx + skippy) < 0 { 3150 return ErrInvalidLengthType 3151 } 3152 if (iNdEx + skippy) > l { 3153 return io.ErrUnexpectedEOF 3154 } 3155 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 3156 iNdEx += skippy 3157 } 3158 } 3159 3160 if iNdEx > l { 3161 return io.ErrUnexpectedEOF 3162 } 3163 return nil 3164} 3165func (m *Option) Unmarshal(dAtA []byte) error { 3166 l := len(dAtA) 3167 iNdEx := 0 3168 for iNdEx < l { 3169 preIndex := iNdEx 3170 var wire uint64 3171 for shift := uint(0); ; shift += 7 { 3172 if shift >= 64 { 3173 return ErrIntOverflowType 3174 } 3175 if iNdEx >= l { 3176 return io.ErrUnexpectedEOF 3177 } 3178 b := dAtA[iNdEx] 3179 iNdEx++ 3180 wire |= uint64(b&0x7F) << shift 3181 if b < 0x80 { 3182 break 3183 } 3184 } 3185 fieldNum := int32(wire >> 3) 3186 wireType := int(wire & 0x7) 3187 if wireType == 4 { 3188 return fmt.Errorf("proto: Option: wiretype end group for non-group") 3189 } 3190 if fieldNum <= 0 { 3191 return fmt.Errorf("proto: Option: illegal tag %d (wire type %d)", fieldNum, wire) 3192 } 3193 switch fieldNum { 3194 case 1: 3195 if wireType != 2 { 3196 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 3197 } 3198 var stringLen uint64 3199 for shift := uint(0); ; shift += 7 { 3200 if shift >= 64 { 3201 return ErrIntOverflowType 3202 } 3203 if iNdEx >= l { 3204 return io.ErrUnexpectedEOF 3205 } 3206 b := dAtA[iNdEx] 3207 iNdEx++ 3208 stringLen |= uint64(b&0x7F) << shift 3209 if b < 0x80 { 3210 break 3211 } 3212 } 3213 intStringLen := int(stringLen) 3214 if intStringLen < 0 { 3215 return ErrInvalidLengthType 3216 } 3217 postIndex := iNdEx + intStringLen 3218 if postIndex < 0 { 3219 return ErrInvalidLengthType 3220 } 3221 if postIndex > l { 3222 return io.ErrUnexpectedEOF 3223 } 3224 m.Name = string(dAtA[iNdEx:postIndex]) 3225 iNdEx = postIndex 3226 case 2: 3227 if wireType != 2 { 3228 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 3229 } 3230 var msglen int 3231 for shift := uint(0); ; shift += 7 { 3232 if shift >= 64 { 3233 return ErrIntOverflowType 3234 } 3235 if iNdEx >= l { 3236 return io.ErrUnexpectedEOF 3237 } 3238 b := dAtA[iNdEx] 3239 iNdEx++ 3240 msglen |= int(b&0x7F) << shift 3241 if b < 0x80 { 3242 break 3243 } 3244 } 3245 if msglen < 0 { 3246 return ErrInvalidLengthType 3247 } 3248 postIndex := iNdEx + msglen 3249 if postIndex < 0 { 3250 return ErrInvalidLengthType 3251 } 3252 if postIndex > l { 3253 return io.ErrUnexpectedEOF 3254 } 3255 if m.Value == nil { 3256 m.Value = &Any{} 3257 } 3258 if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 3259 return err 3260 } 3261 iNdEx = postIndex 3262 default: 3263 iNdEx = preIndex 3264 skippy, err := skipType(dAtA[iNdEx:]) 3265 if err != nil { 3266 return err 3267 } 3268 if skippy < 0 { 3269 return ErrInvalidLengthType 3270 } 3271 if (iNdEx + skippy) < 0 { 3272 return ErrInvalidLengthType 3273 } 3274 if (iNdEx + skippy) > l { 3275 return io.ErrUnexpectedEOF 3276 } 3277 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 3278 iNdEx += skippy 3279 } 3280 } 3281 3282 if iNdEx > l { 3283 return io.ErrUnexpectedEOF 3284 } 3285 return nil 3286} 3287func skipType(dAtA []byte) (n int, err error) { 3288 l := len(dAtA) 3289 iNdEx := 0 3290 depth := 0 3291 for iNdEx < l { 3292 var wire uint64 3293 for shift := uint(0); ; shift += 7 { 3294 if shift >= 64 { 3295 return 0, ErrIntOverflowType 3296 } 3297 if iNdEx >= l { 3298 return 0, io.ErrUnexpectedEOF 3299 } 3300 b := dAtA[iNdEx] 3301 iNdEx++ 3302 wire |= (uint64(b) & 0x7F) << shift 3303 if b < 0x80 { 3304 break 3305 } 3306 } 3307 wireType := int(wire & 0x7) 3308 switch wireType { 3309 case 0: 3310 for shift := uint(0); ; shift += 7 { 3311 if shift >= 64 { 3312 return 0, ErrIntOverflowType 3313 } 3314 if iNdEx >= l { 3315 return 0, io.ErrUnexpectedEOF 3316 } 3317 iNdEx++ 3318 if dAtA[iNdEx-1] < 0x80 { 3319 break 3320 } 3321 } 3322 case 1: 3323 iNdEx += 8 3324 case 2: 3325 var length int 3326 for shift := uint(0); ; shift += 7 { 3327 if shift >= 64 { 3328 return 0, ErrIntOverflowType 3329 } 3330 if iNdEx >= l { 3331 return 0, io.ErrUnexpectedEOF 3332 } 3333 b := dAtA[iNdEx] 3334 iNdEx++ 3335 length |= (int(b) & 0x7F) << shift 3336 if b < 0x80 { 3337 break 3338 } 3339 } 3340 if length < 0 { 3341 return 0, ErrInvalidLengthType 3342 } 3343 iNdEx += length 3344 case 3: 3345 depth++ 3346 case 4: 3347 if depth == 0 { 3348 return 0, ErrUnexpectedEndOfGroupType 3349 } 3350 depth-- 3351 case 5: 3352 iNdEx += 4 3353 default: 3354 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 3355 } 3356 if iNdEx < 0 { 3357 return 0, ErrInvalidLengthType 3358 } 3359 if depth == 0 { 3360 return iNdEx, nil 3361 } 3362 } 3363 return 0, io.ErrUnexpectedEOF 3364} 3365 3366var ( 3367 ErrInvalidLengthType = fmt.Errorf("proto: negative length found during unmarshaling") 3368 ErrIntOverflowType = fmt.Errorf("proto: integer overflow") 3369 ErrUnexpectedEndOfGroupType = fmt.Errorf("proto: unexpected end of group") 3370) 3371