1// Code generated by protoc-gen-gogo. DO NOT EDIT. 2// source: struct.proto 3 4/* 5 Package types is a generated protocol buffer package. 6 7 It is generated from these files: 8 struct.proto 9 10 It has these top-level messages: 11 Struct 12 Value 13 ListValue 14*/ 15package types 16 17import proto "github.com/gogo/protobuf/proto" 18import fmt "fmt" 19import math "math" 20 21import strconv "strconv" 22 23import strings "strings" 24import reflect "reflect" 25import sortkeys "github.com/gogo/protobuf/sortkeys" 26 27import binary "encoding/binary" 28 29import io "io" 30 31// Reference imports to suppress errors if they are not otherwise used. 32var _ = proto.Marshal 33var _ = fmt.Errorf 34var _ = math.Inf 35 36// This is a compile-time assertion to ensure that this generated file 37// is compatible with the proto package it is being compiled against. 38// A compilation error at this line likely means your copy of the 39// proto package needs to be updated. 40const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 41 42// `NullValue` is a singleton enumeration to represent the null value for the 43// `Value` type union. 44// 45// The JSON representation for `NullValue` is JSON `null`. 46type NullValue int32 47 48const ( 49 // Null value. 50 NULL_VALUE NullValue = 0 51) 52 53var NullValue_name = map[int32]string{ 54 0: "NULL_VALUE", 55} 56var NullValue_value = map[string]int32{ 57 "NULL_VALUE": 0, 58} 59 60func (NullValue) EnumDescriptor() ([]byte, []int) { return fileDescriptorStruct, []int{0} } 61func (NullValue) XXX_WellKnownType() string { return "NullValue" } 62 63// `Struct` represents a structured data value, consisting of fields 64// which map to dynamically typed values. In some languages, `Struct` 65// might be supported by a native representation. For example, in 66// scripting languages like JS a struct is represented as an 67// object. The details of that representation are described together 68// with the proto support for the language. 69// 70// The JSON representation for `Struct` is JSON object. 71type Struct struct { 72 // Unordered map of dynamically typed values. 73 Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"` 74} 75 76func (m *Struct) Reset() { *m = Struct{} } 77func (*Struct) ProtoMessage() {} 78func (*Struct) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{0} } 79func (*Struct) XXX_WellKnownType() string { return "Struct" } 80 81func (m *Struct) GetFields() map[string]*Value { 82 if m != nil { 83 return m.Fields 84 } 85 return nil 86} 87 88// `Value` represents a dynamically typed value which can be either 89// null, a number, a string, a boolean, a recursive struct value, or a 90// list of values. A producer of value is expected to set one of that 91// variants, absence of any variant indicates an error. 92// 93// The JSON representation for `Value` is JSON value. 94type Value struct { 95 // The kind of value. 96 // 97 // Types that are valid to be assigned to Kind: 98 // *Value_NullValue 99 // *Value_NumberValue 100 // *Value_StringValue 101 // *Value_BoolValue 102 // *Value_StructValue 103 // *Value_ListValue 104 Kind isValue_Kind `protobuf_oneof:"kind"` 105} 106 107func (m *Value) Reset() { *m = Value{} } 108func (*Value) ProtoMessage() {} 109func (*Value) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{1} } 110func (*Value) XXX_WellKnownType() string { return "Value" } 111 112type isValue_Kind interface { 113 isValue_Kind() 114 Equal(interface{}) bool 115 MarshalTo([]byte) (int, error) 116 Size() int 117} 118 119type Value_NullValue struct { 120 NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` 121} 122type Value_NumberValue struct { 123 NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"` 124} 125type Value_StringValue struct { 126 StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"` 127} 128type Value_BoolValue struct { 129 BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"` 130} 131type Value_StructValue struct { 132 StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,oneof"` 133} 134type Value_ListValue struct { 135 ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,oneof"` 136} 137 138func (*Value_NullValue) isValue_Kind() {} 139func (*Value_NumberValue) isValue_Kind() {} 140func (*Value_StringValue) isValue_Kind() {} 141func (*Value_BoolValue) isValue_Kind() {} 142func (*Value_StructValue) isValue_Kind() {} 143func (*Value_ListValue) isValue_Kind() {} 144 145func (m *Value) GetKind() isValue_Kind { 146 if m != nil { 147 return m.Kind 148 } 149 return nil 150} 151 152func (m *Value) GetNullValue() NullValue { 153 if x, ok := m.GetKind().(*Value_NullValue); ok { 154 return x.NullValue 155 } 156 return NULL_VALUE 157} 158 159func (m *Value) GetNumberValue() float64 { 160 if x, ok := m.GetKind().(*Value_NumberValue); ok { 161 return x.NumberValue 162 } 163 return 0 164} 165 166func (m *Value) GetStringValue() string { 167 if x, ok := m.GetKind().(*Value_StringValue); ok { 168 return x.StringValue 169 } 170 return "" 171} 172 173func (m *Value) GetBoolValue() bool { 174 if x, ok := m.GetKind().(*Value_BoolValue); ok { 175 return x.BoolValue 176 } 177 return false 178} 179 180func (m *Value) GetStructValue() *Struct { 181 if x, ok := m.GetKind().(*Value_StructValue); ok { 182 return x.StructValue 183 } 184 return nil 185} 186 187func (m *Value) GetListValue() *ListValue { 188 if x, ok := m.GetKind().(*Value_ListValue); ok { 189 return x.ListValue 190 } 191 return nil 192} 193 194// XXX_OneofFuncs is for the internal use of the proto package. 195func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 196 return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{ 197 (*Value_NullValue)(nil), 198 (*Value_NumberValue)(nil), 199 (*Value_StringValue)(nil), 200 (*Value_BoolValue)(nil), 201 (*Value_StructValue)(nil), 202 (*Value_ListValue)(nil), 203 } 204} 205 206func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 207 m := msg.(*Value) 208 // kind 209 switch x := m.Kind.(type) { 210 case *Value_NullValue: 211 _ = b.EncodeVarint(1<<3 | proto.WireVarint) 212 _ = b.EncodeVarint(uint64(x.NullValue)) 213 case *Value_NumberValue: 214 _ = b.EncodeVarint(2<<3 | proto.WireFixed64) 215 _ = b.EncodeFixed64(math.Float64bits(x.NumberValue)) 216 case *Value_StringValue: 217 _ = b.EncodeVarint(3<<3 | proto.WireBytes) 218 _ = b.EncodeStringBytes(x.StringValue) 219 case *Value_BoolValue: 220 t := uint64(0) 221 if x.BoolValue { 222 t = 1 223 } 224 _ = b.EncodeVarint(4<<3 | proto.WireVarint) 225 _ = b.EncodeVarint(t) 226 case *Value_StructValue: 227 _ = b.EncodeVarint(5<<3 | proto.WireBytes) 228 if err := b.EncodeMessage(x.StructValue); err != nil { 229 return err 230 } 231 case *Value_ListValue: 232 _ = b.EncodeVarint(6<<3 | proto.WireBytes) 233 if err := b.EncodeMessage(x.ListValue); err != nil { 234 return err 235 } 236 case nil: 237 default: 238 return fmt.Errorf("Value.Kind has unexpected type %T", x) 239 } 240 return nil 241} 242 243func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 244 m := msg.(*Value) 245 switch tag { 246 case 1: // kind.null_value 247 if wire != proto.WireVarint { 248 return true, proto.ErrInternalBadWireType 249 } 250 x, err := b.DecodeVarint() 251 m.Kind = &Value_NullValue{NullValue(x)} 252 return true, err 253 case 2: // kind.number_value 254 if wire != proto.WireFixed64 { 255 return true, proto.ErrInternalBadWireType 256 } 257 x, err := b.DecodeFixed64() 258 m.Kind = &Value_NumberValue{math.Float64frombits(x)} 259 return true, err 260 case 3: // kind.string_value 261 if wire != proto.WireBytes { 262 return true, proto.ErrInternalBadWireType 263 } 264 x, err := b.DecodeStringBytes() 265 m.Kind = &Value_StringValue{x} 266 return true, err 267 case 4: // kind.bool_value 268 if wire != proto.WireVarint { 269 return true, proto.ErrInternalBadWireType 270 } 271 x, err := b.DecodeVarint() 272 m.Kind = &Value_BoolValue{x != 0} 273 return true, err 274 case 5: // kind.struct_value 275 if wire != proto.WireBytes { 276 return true, proto.ErrInternalBadWireType 277 } 278 msg := new(Struct) 279 err := b.DecodeMessage(msg) 280 m.Kind = &Value_StructValue{msg} 281 return true, err 282 case 6: // kind.list_value 283 if wire != proto.WireBytes { 284 return true, proto.ErrInternalBadWireType 285 } 286 msg := new(ListValue) 287 err := b.DecodeMessage(msg) 288 m.Kind = &Value_ListValue{msg} 289 return true, err 290 default: 291 return false, nil 292 } 293} 294 295func _Value_OneofSizer(msg proto.Message) (n int) { 296 m := msg.(*Value) 297 // kind 298 switch x := m.Kind.(type) { 299 case *Value_NullValue: 300 n += proto.SizeVarint(1<<3 | proto.WireVarint) 301 n += proto.SizeVarint(uint64(x.NullValue)) 302 case *Value_NumberValue: 303 n += proto.SizeVarint(2<<3 | proto.WireFixed64) 304 n += 8 305 case *Value_StringValue: 306 n += proto.SizeVarint(3<<3 | proto.WireBytes) 307 n += proto.SizeVarint(uint64(len(x.StringValue))) 308 n += len(x.StringValue) 309 case *Value_BoolValue: 310 n += proto.SizeVarint(4<<3 | proto.WireVarint) 311 n += 1 312 case *Value_StructValue: 313 s := proto.Size(x.StructValue) 314 n += proto.SizeVarint(5<<3 | proto.WireBytes) 315 n += proto.SizeVarint(uint64(s)) 316 n += s 317 case *Value_ListValue: 318 s := proto.Size(x.ListValue) 319 n += proto.SizeVarint(6<<3 | proto.WireBytes) 320 n += proto.SizeVarint(uint64(s)) 321 n += s 322 case nil: 323 default: 324 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 325 } 326 return n 327} 328 329// `ListValue` is a wrapper around a repeated field of values. 330// 331// The JSON representation for `ListValue` is JSON array. 332type ListValue struct { 333 // Repeated field of dynamically typed values. 334 Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` 335} 336 337func (m *ListValue) Reset() { *m = ListValue{} } 338func (*ListValue) ProtoMessage() {} 339func (*ListValue) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{2} } 340func (*ListValue) XXX_WellKnownType() string { return "ListValue" } 341 342func (m *ListValue) GetValues() []*Value { 343 if m != nil { 344 return m.Values 345 } 346 return nil 347} 348 349func init() { 350 proto.RegisterType((*Struct)(nil), "google.protobuf.Struct") 351 proto.RegisterType((*Value)(nil), "google.protobuf.Value") 352 proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue") 353 proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value) 354} 355func (x NullValue) String() string { 356 s, ok := NullValue_name[int32(x)] 357 if ok { 358 return s 359 } 360 return strconv.Itoa(int(x)) 361} 362func (this *Struct) Equal(that interface{}) bool { 363 if that == nil { 364 return this == nil 365 } 366 367 that1, ok := that.(*Struct) 368 if !ok { 369 that2, ok := that.(Struct) 370 if ok { 371 that1 = &that2 372 } else { 373 return false 374 } 375 } 376 if that1 == nil { 377 return this == nil 378 } else if this == nil { 379 return false 380 } 381 if len(this.Fields) != len(that1.Fields) { 382 return false 383 } 384 for i := range this.Fields { 385 if !this.Fields[i].Equal(that1.Fields[i]) { 386 return false 387 } 388 } 389 return true 390} 391func (this *Value) Equal(that interface{}) bool { 392 if that == nil { 393 return this == nil 394 } 395 396 that1, ok := that.(*Value) 397 if !ok { 398 that2, ok := that.(Value) 399 if ok { 400 that1 = &that2 401 } else { 402 return false 403 } 404 } 405 if that1 == nil { 406 return this == nil 407 } else if this == nil { 408 return false 409 } 410 if that1.Kind == nil { 411 if this.Kind != nil { 412 return false 413 } 414 } else if this.Kind == nil { 415 return false 416 } else if !this.Kind.Equal(that1.Kind) { 417 return false 418 } 419 return true 420} 421func (this *Value_NullValue) Equal(that interface{}) bool { 422 if that == nil { 423 return this == nil 424 } 425 426 that1, ok := that.(*Value_NullValue) 427 if !ok { 428 that2, ok := that.(Value_NullValue) 429 if ok { 430 that1 = &that2 431 } else { 432 return false 433 } 434 } 435 if that1 == nil { 436 return this == nil 437 } else if this == nil { 438 return false 439 } 440 if this.NullValue != that1.NullValue { 441 return false 442 } 443 return true 444} 445func (this *Value_NumberValue) Equal(that interface{}) bool { 446 if that == nil { 447 return this == nil 448 } 449 450 that1, ok := that.(*Value_NumberValue) 451 if !ok { 452 that2, ok := that.(Value_NumberValue) 453 if ok { 454 that1 = &that2 455 } else { 456 return false 457 } 458 } 459 if that1 == nil { 460 return this == nil 461 } else if this == nil { 462 return false 463 } 464 if this.NumberValue != that1.NumberValue { 465 return false 466 } 467 return true 468} 469func (this *Value_StringValue) Equal(that interface{}) bool { 470 if that == nil { 471 return this == nil 472 } 473 474 that1, ok := that.(*Value_StringValue) 475 if !ok { 476 that2, ok := that.(Value_StringValue) 477 if ok { 478 that1 = &that2 479 } else { 480 return false 481 } 482 } 483 if that1 == nil { 484 return this == nil 485 } else if this == nil { 486 return false 487 } 488 if this.StringValue != that1.StringValue { 489 return false 490 } 491 return true 492} 493func (this *Value_BoolValue) Equal(that interface{}) bool { 494 if that == nil { 495 return this == nil 496 } 497 498 that1, ok := that.(*Value_BoolValue) 499 if !ok { 500 that2, ok := that.(Value_BoolValue) 501 if ok { 502 that1 = &that2 503 } else { 504 return false 505 } 506 } 507 if that1 == nil { 508 return this == nil 509 } else if this == nil { 510 return false 511 } 512 if this.BoolValue != that1.BoolValue { 513 return false 514 } 515 return true 516} 517func (this *Value_StructValue) Equal(that interface{}) bool { 518 if that == nil { 519 return this == nil 520 } 521 522 that1, ok := that.(*Value_StructValue) 523 if !ok { 524 that2, ok := that.(Value_StructValue) 525 if ok { 526 that1 = &that2 527 } else { 528 return false 529 } 530 } 531 if that1 == nil { 532 return this == nil 533 } else if this == nil { 534 return false 535 } 536 if !this.StructValue.Equal(that1.StructValue) { 537 return false 538 } 539 return true 540} 541func (this *Value_ListValue) Equal(that interface{}) bool { 542 if that == nil { 543 return this == nil 544 } 545 546 that1, ok := that.(*Value_ListValue) 547 if !ok { 548 that2, ok := that.(Value_ListValue) 549 if ok { 550 that1 = &that2 551 } else { 552 return false 553 } 554 } 555 if that1 == nil { 556 return this == nil 557 } else if this == nil { 558 return false 559 } 560 if !this.ListValue.Equal(that1.ListValue) { 561 return false 562 } 563 return true 564} 565func (this *ListValue) Equal(that interface{}) bool { 566 if that == nil { 567 return this == nil 568 } 569 570 that1, ok := that.(*ListValue) 571 if !ok { 572 that2, ok := that.(ListValue) 573 if ok { 574 that1 = &that2 575 } else { 576 return false 577 } 578 } 579 if that1 == nil { 580 return this == nil 581 } else if this == nil { 582 return false 583 } 584 if len(this.Values) != len(that1.Values) { 585 return false 586 } 587 for i := range this.Values { 588 if !this.Values[i].Equal(that1.Values[i]) { 589 return false 590 } 591 } 592 return true 593} 594func (this *Struct) GoString() string { 595 if this == nil { 596 return "nil" 597 } 598 s := make([]string, 0, 5) 599 s = append(s, "&types.Struct{") 600 keysForFields := make([]string, 0, len(this.Fields)) 601 for k := range this.Fields { 602 keysForFields = append(keysForFields, k) 603 } 604 sortkeys.Strings(keysForFields) 605 mapStringForFields := "map[string]*Value{" 606 for _, k := range keysForFields { 607 mapStringForFields += fmt.Sprintf("%#v: %#v,", k, this.Fields[k]) 608 } 609 mapStringForFields += "}" 610 if this.Fields != nil { 611 s = append(s, "Fields: "+mapStringForFields+",\n") 612 } 613 s = append(s, "}") 614 return strings.Join(s, "") 615} 616func (this *Value) GoString() string { 617 if this == nil { 618 return "nil" 619 } 620 s := make([]string, 0, 10) 621 s = append(s, "&types.Value{") 622 if this.Kind != nil { 623 s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\n") 624 } 625 s = append(s, "}") 626 return strings.Join(s, "") 627} 628func (this *Value_NullValue) GoString() string { 629 if this == nil { 630 return "nil" 631 } 632 s := strings.Join([]string{`&types.Value_NullValue{` + 633 `NullValue:` + fmt.Sprintf("%#v", this.NullValue) + `}`}, ", ") 634 return s 635} 636func (this *Value_NumberValue) GoString() string { 637 if this == nil { 638 return "nil" 639 } 640 s := strings.Join([]string{`&types.Value_NumberValue{` + 641 `NumberValue:` + fmt.Sprintf("%#v", this.NumberValue) + `}`}, ", ") 642 return s 643} 644func (this *Value_StringValue) GoString() string { 645 if this == nil { 646 return "nil" 647 } 648 s := strings.Join([]string{`&types.Value_StringValue{` + 649 `StringValue:` + fmt.Sprintf("%#v", this.StringValue) + `}`}, ", ") 650 return s 651} 652func (this *Value_BoolValue) GoString() string { 653 if this == nil { 654 return "nil" 655 } 656 s := strings.Join([]string{`&types.Value_BoolValue{` + 657 `BoolValue:` + fmt.Sprintf("%#v", this.BoolValue) + `}`}, ", ") 658 return s 659} 660func (this *Value_StructValue) GoString() string { 661 if this == nil { 662 return "nil" 663 } 664 s := strings.Join([]string{`&types.Value_StructValue{` + 665 `StructValue:` + fmt.Sprintf("%#v", this.StructValue) + `}`}, ", ") 666 return s 667} 668func (this *Value_ListValue) GoString() string { 669 if this == nil { 670 return "nil" 671 } 672 s := strings.Join([]string{`&types.Value_ListValue{` + 673 `ListValue:` + fmt.Sprintf("%#v", this.ListValue) + `}`}, ", ") 674 return s 675} 676func (this *ListValue) GoString() string { 677 if this == nil { 678 return "nil" 679 } 680 s := make([]string, 0, 5) 681 s = append(s, "&types.ListValue{") 682 if this.Values != nil { 683 s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") 684 } 685 s = append(s, "}") 686 return strings.Join(s, "") 687} 688func valueToGoStringStruct(v interface{}, typ string) string { 689 rv := reflect.ValueOf(v) 690 if rv.IsNil() { 691 return "nil" 692 } 693 pv := reflect.Indirect(rv).Interface() 694 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 695} 696func (m *Struct) Marshal() (dAtA []byte, err error) { 697 size := m.Size() 698 dAtA = make([]byte, size) 699 n, err := m.MarshalTo(dAtA) 700 if err != nil { 701 return nil, err 702 } 703 return dAtA[:n], nil 704} 705 706func (m *Struct) MarshalTo(dAtA []byte) (int, error) { 707 var i int 708 _ = i 709 var l int 710 _ = l 711 if len(m.Fields) > 0 { 712 for k := range m.Fields { 713 dAtA[i] = 0xa 714 i++ 715 v := m.Fields[k] 716 msgSize := 0 717 if v != nil { 718 msgSize = v.Size() 719 msgSize += 1 + sovStruct(uint64(msgSize)) 720 } 721 mapSize := 1 + len(k) + sovStruct(uint64(len(k))) + msgSize 722 i = encodeVarintStruct(dAtA, i, uint64(mapSize)) 723 dAtA[i] = 0xa 724 i++ 725 i = encodeVarintStruct(dAtA, i, uint64(len(k))) 726 i += copy(dAtA[i:], k) 727 if v != nil { 728 dAtA[i] = 0x12 729 i++ 730 i = encodeVarintStruct(dAtA, i, uint64(v.Size())) 731 n1, err := v.MarshalTo(dAtA[i:]) 732 if err != nil { 733 return 0, err 734 } 735 i += n1 736 } 737 } 738 } 739 return i, nil 740} 741 742func (m *Value) Marshal() (dAtA []byte, err error) { 743 size := m.Size() 744 dAtA = make([]byte, size) 745 n, err := m.MarshalTo(dAtA) 746 if err != nil { 747 return nil, err 748 } 749 return dAtA[:n], nil 750} 751 752func (m *Value) MarshalTo(dAtA []byte) (int, error) { 753 var i int 754 _ = i 755 var l int 756 _ = l 757 if m.Kind != nil { 758 nn2, err := m.Kind.MarshalTo(dAtA[i:]) 759 if err != nil { 760 return 0, err 761 } 762 i += nn2 763 } 764 return i, nil 765} 766 767func (m *Value_NullValue) MarshalTo(dAtA []byte) (int, error) { 768 i := 0 769 dAtA[i] = 0x8 770 i++ 771 i = encodeVarintStruct(dAtA, i, uint64(m.NullValue)) 772 return i, nil 773} 774func (m *Value_NumberValue) MarshalTo(dAtA []byte) (int, error) { 775 i := 0 776 dAtA[i] = 0x11 777 i++ 778 binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.NumberValue)))) 779 i += 8 780 return i, nil 781} 782func (m *Value_StringValue) MarshalTo(dAtA []byte) (int, error) { 783 i := 0 784 dAtA[i] = 0x1a 785 i++ 786 i = encodeVarintStruct(dAtA, i, uint64(len(m.StringValue))) 787 i += copy(dAtA[i:], m.StringValue) 788 return i, nil 789} 790func (m *Value_BoolValue) MarshalTo(dAtA []byte) (int, error) { 791 i := 0 792 dAtA[i] = 0x20 793 i++ 794 if m.BoolValue { 795 dAtA[i] = 1 796 } else { 797 dAtA[i] = 0 798 } 799 i++ 800 return i, nil 801} 802func (m *Value_StructValue) MarshalTo(dAtA []byte) (int, error) { 803 i := 0 804 if m.StructValue != nil { 805 dAtA[i] = 0x2a 806 i++ 807 i = encodeVarintStruct(dAtA, i, uint64(m.StructValue.Size())) 808 n3, err := m.StructValue.MarshalTo(dAtA[i:]) 809 if err != nil { 810 return 0, err 811 } 812 i += n3 813 } 814 return i, nil 815} 816func (m *Value_ListValue) MarshalTo(dAtA []byte) (int, error) { 817 i := 0 818 if m.ListValue != nil { 819 dAtA[i] = 0x32 820 i++ 821 i = encodeVarintStruct(dAtA, i, uint64(m.ListValue.Size())) 822 n4, err := m.ListValue.MarshalTo(dAtA[i:]) 823 if err != nil { 824 return 0, err 825 } 826 i += n4 827 } 828 return i, nil 829} 830func (m *ListValue) Marshal() (dAtA []byte, err error) { 831 size := m.Size() 832 dAtA = make([]byte, size) 833 n, err := m.MarshalTo(dAtA) 834 if err != nil { 835 return nil, err 836 } 837 return dAtA[:n], nil 838} 839 840func (m *ListValue) MarshalTo(dAtA []byte) (int, error) { 841 var i int 842 _ = i 843 var l int 844 _ = l 845 if len(m.Values) > 0 { 846 for _, msg := range m.Values { 847 dAtA[i] = 0xa 848 i++ 849 i = encodeVarintStruct(dAtA, i, uint64(msg.Size())) 850 n, err := msg.MarshalTo(dAtA[i:]) 851 if err != nil { 852 return 0, err 853 } 854 i += n 855 } 856 } 857 return i, nil 858} 859 860func encodeVarintStruct(dAtA []byte, offset int, v uint64) int { 861 for v >= 1<<7 { 862 dAtA[offset] = uint8(v&0x7f | 0x80) 863 v >>= 7 864 offset++ 865 } 866 dAtA[offset] = uint8(v) 867 return offset + 1 868} 869func NewPopulatedStruct(r randyStruct, easy bool) *Struct { 870 this := &Struct{} 871 if r.Intn(10) == 0 { 872 v1 := r.Intn(10) 873 this.Fields = make(map[string]*Value) 874 for i := 0; i < v1; i++ { 875 this.Fields[randStringStruct(r)] = NewPopulatedValue(r, easy) 876 } 877 } 878 if !easy && r.Intn(10) != 0 { 879 } 880 return this 881} 882 883func NewPopulatedValue(r randyStruct, easy bool) *Value { 884 this := &Value{} 885 oneofNumber_Kind := []int32{1, 2, 3, 4, 5, 6}[r.Intn(6)] 886 switch oneofNumber_Kind { 887 case 1: 888 this.Kind = NewPopulatedValue_NullValue(r, easy) 889 case 2: 890 this.Kind = NewPopulatedValue_NumberValue(r, easy) 891 case 3: 892 this.Kind = NewPopulatedValue_StringValue(r, easy) 893 case 4: 894 this.Kind = NewPopulatedValue_BoolValue(r, easy) 895 case 5: 896 this.Kind = NewPopulatedValue_StructValue(r, easy) 897 case 6: 898 this.Kind = NewPopulatedValue_ListValue(r, easy) 899 } 900 if !easy && r.Intn(10) != 0 { 901 } 902 return this 903} 904 905func NewPopulatedValue_NullValue(r randyStruct, easy bool) *Value_NullValue { 906 this := &Value_NullValue{} 907 this.NullValue = NullValue([]int32{0}[r.Intn(1)]) 908 return this 909} 910func NewPopulatedValue_NumberValue(r randyStruct, easy bool) *Value_NumberValue { 911 this := &Value_NumberValue{} 912 this.NumberValue = float64(r.Float64()) 913 if r.Intn(2) == 0 { 914 this.NumberValue *= -1 915 } 916 return this 917} 918func NewPopulatedValue_StringValue(r randyStruct, easy bool) *Value_StringValue { 919 this := &Value_StringValue{} 920 this.StringValue = string(randStringStruct(r)) 921 return this 922} 923func NewPopulatedValue_BoolValue(r randyStruct, easy bool) *Value_BoolValue { 924 this := &Value_BoolValue{} 925 this.BoolValue = bool(bool(r.Intn(2) == 0)) 926 return this 927} 928func NewPopulatedValue_StructValue(r randyStruct, easy bool) *Value_StructValue { 929 this := &Value_StructValue{} 930 this.StructValue = NewPopulatedStruct(r, easy) 931 return this 932} 933func NewPopulatedValue_ListValue(r randyStruct, easy bool) *Value_ListValue { 934 this := &Value_ListValue{} 935 this.ListValue = NewPopulatedListValue(r, easy) 936 return this 937} 938func NewPopulatedListValue(r randyStruct, easy bool) *ListValue { 939 this := &ListValue{} 940 if r.Intn(10) == 0 { 941 v2 := r.Intn(5) 942 this.Values = make([]*Value, v2) 943 for i := 0; i < v2; i++ { 944 this.Values[i] = NewPopulatedValue(r, easy) 945 } 946 } 947 if !easy && r.Intn(10) != 0 { 948 } 949 return this 950} 951 952type randyStruct interface { 953 Float32() float32 954 Float64() float64 955 Int63() int64 956 Int31() int32 957 Uint32() uint32 958 Intn(n int) int 959} 960 961func randUTF8RuneStruct(r randyStruct) rune { 962 ru := r.Intn(62) 963 if ru < 10 { 964 return rune(ru + 48) 965 } else if ru < 36 { 966 return rune(ru + 55) 967 } 968 return rune(ru + 61) 969} 970func randStringStruct(r randyStruct) string { 971 v3 := r.Intn(100) 972 tmps := make([]rune, v3) 973 for i := 0; i < v3; i++ { 974 tmps[i] = randUTF8RuneStruct(r) 975 } 976 return string(tmps) 977} 978func randUnrecognizedStruct(r randyStruct, maxFieldNumber int) (dAtA []byte) { 979 l := r.Intn(5) 980 for i := 0; i < l; i++ { 981 wire := r.Intn(4) 982 if wire == 3 { 983 wire = 5 984 } 985 fieldNumber := maxFieldNumber + r.Intn(100) 986 dAtA = randFieldStruct(dAtA, r, fieldNumber, wire) 987 } 988 return dAtA 989} 990func randFieldStruct(dAtA []byte, r randyStruct, fieldNumber int, wire int) []byte { 991 key := uint32(fieldNumber)<<3 | uint32(wire) 992 switch wire { 993 case 0: 994 dAtA = encodeVarintPopulateStruct(dAtA, uint64(key)) 995 v4 := r.Int63() 996 if r.Intn(2) == 0 { 997 v4 *= -1 998 } 999 dAtA = encodeVarintPopulateStruct(dAtA, uint64(v4)) 1000 case 1: 1001 dAtA = encodeVarintPopulateStruct(dAtA, uint64(key)) 1002 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))) 1003 case 2: 1004 dAtA = encodeVarintPopulateStruct(dAtA, uint64(key)) 1005 ll := r.Intn(100) 1006 dAtA = encodeVarintPopulateStruct(dAtA, uint64(ll)) 1007 for j := 0; j < ll; j++ { 1008 dAtA = append(dAtA, byte(r.Intn(256))) 1009 } 1010 default: 1011 dAtA = encodeVarintPopulateStruct(dAtA, uint64(key)) 1012 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 1013 } 1014 return dAtA 1015} 1016func encodeVarintPopulateStruct(dAtA []byte, v uint64) []byte { 1017 for v >= 1<<7 { 1018 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) 1019 v >>= 7 1020 } 1021 dAtA = append(dAtA, uint8(v)) 1022 return dAtA 1023} 1024func (m *Struct) Size() (n int) { 1025 var l int 1026 _ = l 1027 if len(m.Fields) > 0 { 1028 for k, v := range m.Fields { 1029 _ = k 1030 _ = v 1031 l = 0 1032 if v != nil { 1033 l = v.Size() 1034 l += 1 + sovStruct(uint64(l)) 1035 } 1036 mapEntrySize := 1 + len(k) + sovStruct(uint64(len(k))) + l 1037 n += mapEntrySize + 1 + sovStruct(uint64(mapEntrySize)) 1038 } 1039 } 1040 return n 1041} 1042 1043func (m *Value) Size() (n int) { 1044 var l int 1045 _ = l 1046 if m.Kind != nil { 1047 n += m.Kind.Size() 1048 } 1049 return n 1050} 1051 1052func (m *Value_NullValue) Size() (n int) { 1053 var l int 1054 _ = l 1055 n += 1 + sovStruct(uint64(m.NullValue)) 1056 return n 1057} 1058func (m *Value_NumberValue) Size() (n int) { 1059 var l int 1060 _ = l 1061 n += 9 1062 return n 1063} 1064func (m *Value_StringValue) Size() (n int) { 1065 var l int 1066 _ = l 1067 l = len(m.StringValue) 1068 n += 1 + l + sovStruct(uint64(l)) 1069 return n 1070} 1071func (m *Value_BoolValue) Size() (n int) { 1072 var l int 1073 _ = l 1074 n += 2 1075 return n 1076} 1077func (m *Value_StructValue) Size() (n int) { 1078 var l int 1079 _ = l 1080 if m.StructValue != nil { 1081 l = m.StructValue.Size() 1082 n += 1 + l + sovStruct(uint64(l)) 1083 } 1084 return n 1085} 1086func (m *Value_ListValue) Size() (n int) { 1087 var l int 1088 _ = l 1089 if m.ListValue != nil { 1090 l = m.ListValue.Size() 1091 n += 1 + l + sovStruct(uint64(l)) 1092 } 1093 return n 1094} 1095func (m *ListValue) Size() (n int) { 1096 var l int 1097 _ = l 1098 if len(m.Values) > 0 { 1099 for _, e := range m.Values { 1100 l = e.Size() 1101 n += 1 + l + sovStruct(uint64(l)) 1102 } 1103 } 1104 return n 1105} 1106 1107func sovStruct(x uint64) (n int) { 1108 for { 1109 n++ 1110 x >>= 7 1111 if x == 0 { 1112 break 1113 } 1114 } 1115 return n 1116} 1117func sozStruct(x uint64) (n int) { 1118 return sovStruct(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1119} 1120func (this *Struct) String() string { 1121 if this == nil { 1122 return "nil" 1123 } 1124 keysForFields := make([]string, 0, len(this.Fields)) 1125 for k := range this.Fields { 1126 keysForFields = append(keysForFields, k) 1127 } 1128 sortkeys.Strings(keysForFields) 1129 mapStringForFields := "map[string]*Value{" 1130 for _, k := range keysForFields { 1131 mapStringForFields += fmt.Sprintf("%v: %v,", k, this.Fields[k]) 1132 } 1133 mapStringForFields += "}" 1134 s := strings.Join([]string{`&Struct{`, 1135 `Fields:` + mapStringForFields + `,`, 1136 `}`, 1137 }, "") 1138 return s 1139} 1140func (this *Value) String() string { 1141 if this == nil { 1142 return "nil" 1143 } 1144 s := strings.Join([]string{`&Value{`, 1145 `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, 1146 `}`, 1147 }, "") 1148 return s 1149} 1150func (this *Value_NullValue) String() string { 1151 if this == nil { 1152 return "nil" 1153 } 1154 s := strings.Join([]string{`&Value_NullValue{`, 1155 `NullValue:` + fmt.Sprintf("%v", this.NullValue) + `,`, 1156 `}`, 1157 }, "") 1158 return s 1159} 1160func (this *Value_NumberValue) String() string { 1161 if this == nil { 1162 return "nil" 1163 } 1164 s := strings.Join([]string{`&Value_NumberValue{`, 1165 `NumberValue:` + fmt.Sprintf("%v", this.NumberValue) + `,`, 1166 `}`, 1167 }, "") 1168 return s 1169} 1170func (this *Value_StringValue) String() string { 1171 if this == nil { 1172 return "nil" 1173 } 1174 s := strings.Join([]string{`&Value_StringValue{`, 1175 `StringValue:` + fmt.Sprintf("%v", this.StringValue) + `,`, 1176 `}`, 1177 }, "") 1178 return s 1179} 1180func (this *Value_BoolValue) String() string { 1181 if this == nil { 1182 return "nil" 1183 } 1184 s := strings.Join([]string{`&Value_BoolValue{`, 1185 `BoolValue:` + fmt.Sprintf("%v", this.BoolValue) + `,`, 1186 `}`, 1187 }, "") 1188 return s 1189} 1190func (this *Value_StructValue) String() string { 1191 if this == nil { 1192 return "nil" 1193 } 1194 s := strings.Join([]string{`&Value_StructValue{`, 1195 `StructValue:` + strings.Replace(fmt.Sprintf("%v", this.StructValue), "Struct", "Struct", 1) + `,`, 1196 `}`, 1197 }, "") 1198 return s 1199} 1200func (this *Value_ListValue) String() string { 1201 if this == nil { 1202 return "nil" 1203 } 1204 s := strings.Join([]string{`&Value_ListValue{`, 1205 `ListValue:` + strings.Replace(fmt.Sprintf("%v", this.ListValue), "ListValue", "ListValue", 1) + `,`, 1206 `}`, 1207 }, "") 1208 return s 1209} 1210func (this *ListValue) String() string { 1211 if this == nil { 1212 return "nil" 1213 } 1214 s := strings.Join([]string{`&ListValue{`, 1215 `Values:` + strings.Replace(fmt.Sprintf("%v", this.Values), "Value", "Value", 1) + `,`, 1216 `}`, 1217 }, "") 1218 return s 1219} 1220func valueToStringStruct(v interface{}) string { 1221 rv := reflect.ValueOf(v) 1222 if rv.IsNil() { 1223 return "nil" 1224 } 1225 pv := reflect.Indirect(rv).Interface() 1226 return fmt.Sprintf("*%v", pv) 1227} 1228func (m *Struct) Unmarshal(dAtA []byte) error { 1229 l := len(dAtA) 1230 iNdEx := 0 1231 for iNdEx < l { 1232 preIndex := iNdEx 1233 var wire uint64 1234 for shift := uint(0); ; shift += 7 { 1235 if shift >= 64 { 1236 return ErrIntOverflowStruct 1237 } 1238 if iNdEx >= l { 1239 return io.ErrUnexpectedEOF 1240 } 1241 b := dAtA[iNdEx] 1242 iNdEx++ 1243 wire |= (uint64(b) & 0x7F) << shift 1244 if b < 0x80 { 1245 break 1246 } 1247 } 1248 fieldNum := int32(wire >> 3) 1249 wireType := int(wire & 0x7) 1250 if wireType == 4 { 1251 return fmt.Errorf("proto: Struct: wiretype end group for non-group") 1252 } 1253 if fieldNum <= 0 { 1254 return fmt.Errorf("proto: Struct: illegal tag %d (wire type %d)", fieldNum, wire) 1255 } 1256 switch fieldNum { 1257 case 1: 1258 if wireType != 2 { 1259 return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) 1260 } 1261 var msglen int 1262 for shift := uint(0); ; shift += 7 { 1263 if shift >= 64 { 1264 return ErrIntOverflowStruct 1265 } 1266 if iNdEx >= l { 1267 return io.ErrUnexpectedEOF 1268 } 1269 b := dAtA[iNdEx] 1270 iNdEx++ 1271 msglen |= (int(b) & 0x7F) << shift 1272 if b < 0x80 { 1273 break 1274 } 1275 } 1276 if msglen < 0 { 1277 return ErrInvalidLengthStruct 1278 } 1279 postIndex := iNdEx + msglen 1280 if postIndex > l { 1281 return io.ErrUnexpectedEOF 1282 } 1283 if m.Fields == nil { 1284 m.Fields = make(map[string]*Value) 1285 } 1286 var mapkey string 1287 var mapvalue *Value 1288 for iNdEx < postIndex { 1289 entryPreIndex := iNdEx 1290 var wire uint64 1291 for shift := uint(0); ; shift += 7 { 1292 if shift >= 64 { 1293 return ErrIntOverflowStruct 1294 } 1295 if iNdEx >= l { 1296 return io.ErrUnexpectedEOF 1297 } 1298 b := dAtA[iNdEx] 1299 iNdEx++ 1300 wire |= (uint64(b) & 0x7F) << shift 1301 if b < 0x80 { 1302 break 1303 } 1304 } 1305 fieldNum := int32(wire >> 3) 1306 if fieldNum == 1 { 1307 var stringLenmapkey uint64 1308 for shift := uint(0); ; shift += 7 { 1309 if shift >= 64 { 1310 return ErrIntOverflowStruct 1311 } 1312 if iNdEx >= l { 1313 return io.ErrUnexpectedEOF 1314 } 1315 b := dAtA[iNdEx] 1316 iNdEx++ 1317 stringLenmapkey |= (uint64(b) & 0x7F) << shift 1318 if b < 0x80 { 1319 break 1320 } 1321 } 1322 intStringLenmapkey := int(stringLenmapkey) 1323 if intStringLenmapkey < 0 { 1324 return ErrInvalidLengthStruct 1325 } 1326 postStringIndexmapkey := iNdEx + intStringLenmapkey 1327 if postStringIndexmapkey > l { 1328 return io.ErrUnexpectedEOF 1329 } 1330 mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) 1331 iNdEx = postStringIndexmapkey 1332 } else if fieldNum == 2 { 1333 var mapmsglen int 1334 for shift := uint(0); ; shift += 7 { 1335 if shift >= 64 { 1336 return ErrIntOverflowStruct 1337 } 1338 if iNdEx >= l { 1339 return io.ErrUnexpectedEOF 1340 } 1341 b := dAtA[iNdEx] 1342 iNdEx++ 1343 mapmsglen |= (int(b) & 0x7F) << shift 1344 if b < 0x80 { 1345 break 1346 } 1347 } 1348 if mapmsglen < 0 { 1349 return ErrInvalidLengthStruct 1350 } 1351 postmsgIndex := iNdEx + mapmsglen 1352 if mapmsglen < 0 { 1353 return ErrInvalidLengthStruct 1354 } 1355 if postmsgIndex > l { 1356 return io.ErrUnexpectedEOF 1357 } 1358 mapvalue = &Value{} 1359 if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { 1360 return err 1361 } 1362 iNdEx = postmsgIndex 1363 } else { 1364 iNdEx = entryPreIndex 1365 skippy, err := skipStruct(dAtA[iNdEx:]) 1366 if err != nil { 1367 return err 1368 } 1369 if skippy < 0 { 1370 return ErrInvalidLengthStruct 1371 } 1372 if (iNdEx + skippy) > postIndex { 1373 return io.ErrUnexpectedEOF 1374 } 1375 iNdEx += skippy 1376 } 1377 } 1378 m.Fields[mapkey] = mapvalue 1379 iNdEx = postIndex 1380 default: 1381 iNdEx = preIndex 1382 skippy, err := skipStruct(dAtA[iNdEx:]) 1383 if err != nil { 1384 return err 1385 } 1386 if skippy < 0 { 1387 return ErrInvalidLengthStruct 1388 } 1389 if (iNdEx + skippy) > l { 1390 return io.ErrUnexpectedEOF 1391 } 1392 iNdEx += skippy 1393 } 1394 } 1395 1396 if iNdEx > l { 1397 return io.ErrUnexpectedEOF 1398 } 1399 return nil 1400} 1401func (m *Value) Unmarshal(dAtA []byte) error { 1402 l := len(dAtA) 1403 iNdEx := 0 1404 for iNdEx < l { 1405 preIndex := iNdEx 1406 var wire uint64 1407 for shift := uint(0); ; shift += 7 { 1408 if shift >= 64 { 1409 return ErrIntOverflowStruct 1410 } 1411 if iNdEx >= l { 1412 return io.ErrUnexpectedEOF 1413 } 1414 b := dAtA[iNdEx] 1415 iNdEx++ 1416 wire |= (uint64(b) & 0x7F) << shift 1417 if b < 0x80 { 1418 break 1419 } 1420 } 1421 fieldNum := int32(wire >> 3) 1422 wireType := int(wire & 0x7) 1423 if wireType == 4 { 1424 return fmt.Errorf("proto: Value: wiretype end group for non-group") 1425 } 1426 if fieldNum <= 0 { 1427 return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire) 1428 } 1429 switch fieldNum { 1430 case 1: 1431 if wireType != 0 { 1432 return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType) 1433 } 1434 var v NullValue 1435 for shift := uint(0); ; shift += 7 { 1436 if shift >= 64 { 1437 return ErrIntOverflowStruct 1438 } 1439 if iNdEx >= l { 1440 return io.ErrUnexpectedEOF 1441 } 1442 b := dAtA[iNdEx] 1443 iNdEx++ 1444 v |= (NullValue(b) & 0x7F) << shift 1445 if b < 0x80 { 1446 break 1447 } 1448 } 1449 m.Kind = &Value_NullValue{v} 1450 case 2: 1451 if wireType != 1 { 1452 return fmt.Errorf("proto: wrong wireType = %d for field NumberValue", wireType) 1453 } 1454 var v uint64 1455 if (iNdEx + 8) > l { 1456 return io.ErrUnexpectedEOF 1457 } 1458 v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) 1459 iNdEx += 8 1460 m.Kind = &Value_NumberValue{float64(math.Float64frombits(v))} 1461 case 3: 1462 if wireType != 2 { 1463 return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) 1464 } 1465 var stringLen uint64 1466 for shift := uint(0); ; shift += 7 { 1467 if shift >= 64 { 1468 return ErrIntOverflowStruct 1469 } 1470 if iNdEx >= l { 1471 return io.ErrUnexpectedEOF 1472 } 1473 b := dAtA[iNdEx] 1474 iNdEx++ 1475 stringLen |= (uint64(b) & 0x7F) << shift 1476 if b < 0x80 { 1477 break 1478 } 1479 } 1480 intStringLen := int(stringLen) 1481 if intStringLen < 0 { 1482 return ErrInvalidLengthStruct 1483 } 1484 postIndex := iNdEx + intStringLen 1485 if postIndex > l { 1486 return io.ErrUnexpectedEOF 1487 } 1488 m.Kind = &Value_StringValue{string(dAtA[iNdEx:postIndex])} 1489 iNdEx = postIndex 1490 case 4: 1491 if wireType != 0 { 1492 return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) 1493 } 1494 var v int 1495 for shift := uint(0); ; shift += 7 { 1496 if shift >= 64 { 1497 return ErrIntOverflowStruct 1498 } 1499 if iNdEx >= l { 1500 return io.ErrUnexpectedEOF 1501 } 1502 b := dAtA[iNdEx] 1503 iNdEx++ 1504 v |= (int(b) & 0x7F) << shift 1505 if b < 0x80 { 1506 break 1507 } 1508 } 1509 b := bool(v != 0) 1510 m.Kind = &Value_BoolValue{b} 1511 case 5: 1512 if wireType != 2 { 1513 return fmt.Errorf("proto: wrong wireType = %d for field StructValue", wireType) 1514 } 1515 var msglen int 1516 for shift := uint(0); ; shift += 7 { 1517 if shift >= 64 { 1518 return ErrIntOverflowStruct 1519 } 1520 if iNdEx >= l { 1521 return io.ErrUnexpectedEOF 1522 } 1523 b := dAtA[iNdEx] 1524 iNdEx++ 1525 msglen |= (int(b) & 0x7F) << shift 1526 if b < 0x80 { 1527 break 1528 } 1529 } 1530 if msglen < 0 { 1531 return ErrInvalidLengthStruct 1532 } 1533 postIndex := iNdEx + msglen 1534 if postIndex > l { 1535 return io.ErrUnexpectedEOF 1536 } 1537 v := &Struct{} 1538 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1539 return err 1540 } 1541 m.Kind = &Value_StructValue{v} 1542 iNdEx = postIndex 1543 case 6: 1544 if wireType != 2 { 1545 return fmt.Errorf("proto: wrong wireType = %d for field ListValue", wireType) 1546 } 1547 var msglen int 1548 for shift := uint(0); ; shift += 7 { 1549 if shift >= 64 { 1550 return ErrIntOverflowStruct 1551 } 1552 if iNdEx >= l { 1553 return io.ErrUnexpectedEOF 1554 } 1555 b := dAtA[iNdEx] 1556 iNdEx++ 1557 msglen |= (int(b) & 0x7F) << shift 1558 if b < 0x80 { 1559 break 1560 } 1561 } 1562 if msglen < 0 { 1563 return ErrInvalidLengthStruct 1564 } 1565 postIndex := iNdEx + msglen 1566 if postIndex > l { 1567 return io.ErrUnexpectedEOF 1568 } 1569 v := &ListValue{} 1570 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1571 return err 1572 } 1573 m.Kind = &Value_ListValue{v} 1574 iNdEx = postIndex 1575 default: 1576 iNdEx = preIndex 1577 skippy, err := skipStruct(dAtA[iNdEx:]) 1578 if err != nil { 1579 return err 1580 } 1581 if skippy < 0 { 1582 return ErrInvalidLengthStruct 1583 } 1584 if (iNdEx + skippy) > l { 1585 return io.ErrUnexpectedEOF 1586 } 1587 iNdEx += skippy 1588 } 1589 } 1590 1591 if iNdEx > l { 1592 return io.ErrUnexpectedEOF 1593 } 1594 return nil 1595} 1596func (m *ListValue) Unmarshal(dAtA []byte) error { 1597 l := len(dAtA) 1598 iNdEx := 0 1599 for iNdEx < l { 1600 preIndex := iNdEx 1601 var wire uint64 1602 for shift := uint(0); ; shift += 7 { 1603 if shift >= 64 { 1604 return ErrIntOverflowStruct 1605 } 1606 if iNdEx >= l { 1607 return io.ErrUnexpectedEOF 1608 } 1609 b := dAtA[iNdEx] 1610 iNdEx++ 1611 wire |= (uint64(b) & 0x7F) << shift 1612 if b < 0x80 { 1613 break 1614 } 1615 } 1616 fieldNum := int32(wire >> 3) 1617 wireType := int(wire & 0x7) 1618 if wireType == 4 { 1619 return fmt.Errorf("proto: ListValue: wiretype end group for non-group") 1620 } 1621 if fieldNum <= 0 { 1622 return fmt.Errorf("proto: ListValue: illegal tag %d (wire type %d)", fieldNum, wire) 1623 } 1624 switch fieldNum { 1625 case 1: 1626 if wireType != 2 { 1627 return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) 1628 } 1629 var msglen int 1630 for shift := uint(0); ; shift += 7 { 1631 if shift >= 64 { 1632 return ErrIntOverflowStruct 1633 } 1634 if iNdEx >= l { 1635 return io.ErrUnexpectedEOF 1636 } 1637 b := dAtA[iNdEx] 1638 iNdEx++ 1639 msglen |= (int(b) & 0x7F) << shift 1640 if b < 0x80 { 1641 break 1642 } 1643 } 1644 if msglen < 0 { 1645 return ErrInvalidLengthStruct 1646 } 1647 postIndex := iNdEx + msglen 1648 if postIndex > l { 1649 return io.ErrUnexpectedEOF 1650 } 1651 m.Values = append(m.Values, &Value{}) 1652 if err := m.Values[len(m.Values)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1653 return err 1654 } 1655 iNdEx = postIndex 1656 default: 1657 iNdEx = preIndex 1658 skippy, err := skipStruct(dAtA[iNdEx:]) 1659 if err != nil { 1660 return err 1661 } 1662 if skippy < 0 { 1663 return ErrInvalidLengthStruct 1664 } 1665 if (iNdEx + skippy) > l { 1666 return io.ErrUnexpectedEOF 1667 } 1668 iNdEx += skippy 1669 } 1670 } 1671 1672 if iNdEx > l { 1673 return io.ErrUnexpectedEOF 1674 } 1675 return nil 1676} 1677func skipStruct(dAtA []byte) (n int, err error) { 1678 l := len(dAtA) 1679 iNdEx := 0 1680 for iNdEx < l { 1681 var wire uint64 1682 for shift := uint(0); ; shift += 7 { 1683 if shift >= 64 { 1684 return 0, ErrIntOverflowStruct 1685 } 1686 if iNdEx >= l { 1687 return 0, io.ErrUnexpectedEOF 1688 } 1689 b := dAtA[iNdEx] 1690 iNdEx++ 1691 wire |= (uint64(b) & 0x7F) << shift 1692 if b < 0x80 { 1693 break 1694 } 1695 } 1696 wireType := int(wire & 0x7) 1697 switch wireType { 1698 case 0: 1699 for shift := uint(0); ; shift += 7 { 1700 if shift >= 64 { 1701 return 0, ErrIntOverflowStruct 1702 } 1703 if iNdEx >= l { 1704 return 0, io.ErrUnexpectedEOF 1705 } 1706 iNdEx++ 1707 if dAtA[iNdEx-1] < 0x80 { 1708 break 1709 } 1710 } 1711 return iNdEx, nil 1712 case 1: 1713 iNdEx += 8 1714 return iNdEx, nil 1715 case 2: 1716 var length int 1717 for shift := uint(0); ; shift += 7 { 1718 if shift >= 64 { 1719 return 0, ErrIntOverflowStruct 1720 } 1721 if iNdEx >= l { 1722 return 0, io.ErrUnexpectedEOF 1723 } 1724 b := dAtA[iNdEx] 1725 iNdEx++ 1726 length |= (int(b) & 0x7F) << shift 1727 if b < 0x80 { 1728 break 1729 } 1730 } 1731 iNdEx += length 1732 if length < 0 { 1733 return 0, ErrInvalidLengthStruct 1734 } 1735 return iNdEx, nil 1736 case 3: 1737 for { 1738 var innerWire uint64 1739 var start int = iNdEx 1740 for shift := uint(0); ; shift += 7 { 1741 if shift >= 64 { 1742 return 0, ErrIntOverflowStruct 1743 } 1744 if iNdEx >= l { 1745 return 0, io.ErrUnexpectedEOF 1746 } 1747 b := dAtA[iNdEx] 1748 iNdEx++ 1749 innerWire |= (uint64(b) & 0x7F) << shift 1750 if b < 0x80 { 1751 break 1752 } 1753 } 1754 innerWireType := int(innerWire & 0x7) 1755 if innerWireType == 4 { 1756 break 1757 } 1758 next, err := skipStruct(dAtA[start:]) 1759 if err != nil { 1760 return 0, err 1761 } 1762 iNdEx = start + next 1763 } 1764 return iNdEx, nil 1765 case 4: 1766 return iNdEx, nil 1767 case 5: 1768 iNdEx += 4 1769 return iNdEx, nil 1770 default: 1771 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1772 } 1773 } 1774 panic("unreachable") 1775} 1776 1777var ( 1778 ErrInvalidLengthStruct = fmt.Errorf("proto: negative length found during unmarshaling") 1779 ErrIntOverflowStruct = fmt.Errorf("proto: integer overflow") 1780) 1781 1782func init() { proto.RegisterFile("struct.proto", fileDescriptorStruct) } 1783 1784var fileDescriptorStruct = []byte{ 1785 // 432 bytes of a gzipped FileDescriptorProto 1786 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xb1, 0x6f, 0xd3, 0x40, 1787 0x14, 0xc6, 0xfd, 0x9c, 0xc6, 0x22, 0xcf, 0x55, 0xa9, 0x0e, 0x09, 0xa2, 0x22, 0x1d, 0x51, 0xba, 1788 0x58, 0x08, 0x79, 0x08, 0x0b, 0x22, 0x2c, 0x58, 0x2a, 0xad, 0x84, 0x55, 0x19, 0x43, 0x8b, 0xc4, 1789 0x12, 0xe1, 0xd4, 0x8d, 0xac, 0x5e, 0xef, 0x2a, 0xfb, 0x0c, 0xca, 0x06, 0xff, 0x05, 0x33, 0x13, 1790 0x62, 0xe4, 0xaf, 0x60, 0xec, 0xc8, 0x88, 0x3d, 0x31, 0x76, 0xec, 0x88, 0xee, 0xce, 0x36, 0xa8, 1791 0x51, 0x36, 0xbf, 0xcf, 0xbf, 0xf7, 0xbd, 0xf7, 0xbd, 0xc3, 0xcd, 0x42, 0xe6, 0xe5, 0x5c, 0xfa, 1792 0x17, 0xb9, 0x90, 0x82, 0xdc, 0x5e, 0x08, 0xb1, 0x60, 0xa9, 0xa9, 0x92, 0xf2, 0x74, 0xfc, 0x05, 1793 0xd0, 0x79, 0xad, 0x09, 0x32, 0x45, 0xe7, 0x34, 0x4b, 0xd9, 0x49, 0x31, 0x84, 0x51, 0xcf, 0x73, 1794 0x27, 0xbb, 0xfe, 0x0d, 0xd8, 0x37, 0xa0, 0xff, 0x42, 0x53, 0x7b, 0x5c, 0xe6, 0xcb, 0xb8, 0x69, 1795 0xd9, 0x79, 0x85, 0xee, 0x7f, 0x32, 0xd9, 0xc6, 0xde, 0x59, 0xba, 0x1c, 0xc2, 0x08, 0xbc, 0x41, 1796 0xac, 0x3e, 0xc9, 0x23, 0xec, 0x7f, 0x78, 0xcf, 0xca, 0x74, 0x68, 0x8f, 0xc0, 0x73, 0x27, 0x77, 1797 0x57, 0xcc, 0x8f, 0xd5, 0xdf, 0xd8, 0x40, 0x4f, 0xed, 0x27, 0x30, 0xfe, 0x61, 0x63, 0x5f, 0x8b, 1798 0x64, 0x8a, 0xc8, 0x4b, 0xc6, 0x66, 0xc6, 0x40, 0x99, 0x6e, 0x4d, 0x76, 0x56, 0x0c, 0x0e, 0x4b, 1799 0xc6, 0x34, 0x7f, 0x60, 0xc5, 0x03, 0xde, 0x16, 0x64, 0x17, 0x37, 0x79, 0x79, 0x9e, 0xa4, 0xf9, 1800 0xec, 0xdf, 0x7c, 0x38, 0xb0, 0x62, 0xd7, 0xa8, 0x1d, 0x54, 0xc8, 0x3c, 0xe3, 0x8b, 0x06, 0xea, 1801 0xa9, 0xc5, 0x15, 0x64, 0x54, 0x03, 0x3d, 0x40, 0x4c, 0x84, 0x68, 0xd7, 0xd8, 0x18, 0x81, 0x77, 1802 0x4b, 0x8d, 0x52, 0x9a, 0x01, 0x9e, 0xb5, 0xd7, 0x6e, 0x90, 0xbe, 0x8e, 0x7a, 0x6f, 0xcd, 0x1d, 1803 0x1b, 0xfb, 0x72, 0x2e, 0xbb, 0x94, 0x2c, 0x2b, 0xda, 0x5e, 0x47, 0xf7, 0xae, 0xa6, 0x0c, 0xb3, 1804 0x42, 0x76, 0x29, 0x59, 0x5b, 0x04, 0x0e, 0x6e, 0x9c, 0x65, 0xfc, 0x64, 0x3c, 0xc5, 0x41, 0x47, 1805 0x10, 0x1f, 0x1d, 0x6d, 0xd6, 0xbe, 0xe8, 0xba, 0xa3, 0x37, 0xd4, 0xc3, 0xfb, 0x38, 0xe8, 0x8e, 1806 0x48, 0xb6, 0x10, 0x0f, 0x8f, 0xc2, 0x70, 0x76, 0xfc, 0x3c, 0x3c, 0xda, 0xdb, 0xb6, 0x82, 0xcf, 1807 0x70, 0x59, 0x51, 0xeb, 0x57, 0x45, 0xad, 0xab, 0x8a, 0xc2, 0x75, 0x45, 0xe1, 0x53, 0x4d, 0xe1, 1808 0x5b, 0x4d, 0xe1, 0x67, 0x4d, 0xe1, 0xb2, 0xa6, 0xf0, 0xbb, 0xa6, 0xf0, 0xa7, 0xa6, 0xd6, 0x55, 1809 0x4d, 0x01, 0xef, 0xcc, 0xc5, 0xf9, 0xcd, 0x71, 0x81, 0x6b, 0x92, 0x47, 0xaa, 0x8e, 0xe0, 0x5d, 1810 0x5f, 0x2e, 0x2f, 0xd2, 0xe2, 0x1a, 0xe0, 0xab, 0xdd, 0xdb, 0x8f, 0x82, 0xef, 0x36, 0xdd, 0x37, 1811 0x0d, 0x51, 0xbb, 0xdf, 0xdb, 0x94, 0xb1, 0x97, 0x5c, 0x7c, 0xe4, 0x6f, 0x14, 0x99, 0x38, 0xda, 1812 0xe9, 0xf1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x75, 0xc5, 0x1c, 0x3b, 0xd5, 0x02, 0x00, 0x00, 1813} 1814