github.com/cloudwego/dynamicgo@v0.2.6-0.20240519101509-707f41b6b834/testdata/kitex_gen/example2/example2.go (about) 1 // Code generated by thriftgo (0.1.3). DO NOT EDIT. 2 3 package example2 4 5 import ( 6 "bytes" 7 "github.com/cloudwego/dynamicgo/testdata/kitex_gen/base" 8 "context" 9 "database/sql" 10 "database/sql/driver" 11 "fmt" 12 "github.com/apache/thrift/lib/go/thrift" 13 "strings" 14 ) 15 16 type FOO int64 17 18 const ( 19 FOO_A FOO = 1 20 ) 21 22 func (p FOO) String() string { 23 switch p { 24 case FOO_A: 25 return "A" 26 } 27 return "<UNSET>" 28 } 29 30 func FOOFromString(s string) (FOO, error) { 31 switch s { 32 case "A": 33 return FOO_A, nil 34 } 35 return FOO(0), fmt.Errorf("not a valid FOO string") 36 } 37 38 func FOOPtr(v FOO) *FOO { return &v } 39 40 func (p *FOO) Scan(value interface{}) (err error) { 41 var result sql.NullInt64 42 err = result.Scan(value) 43 *p = FOO(result.Int64) 44 return 45 } 46 47 func (p *FOO) Value() (driver.Value, error) { 48 if p == nil { 49 return nil, nil 50 } 51 return int64(*p), nil 52 } 53 54 type InnerBase struct { 55 Bool bool `thrift:"Bool,1" json:"Bool"` 56 Byte int8 `thrift:"Byte,2" json:"Byte"` 57 Int16 int16 `thrift:"Int16,3" json:"Int16"` 58 Int32 int32 `thrift:"Int32,4" json:"Int32"` 59 Int64 int64 `thrift:"Int64,5" json:"Int64"` 60 Double float64 `thrift:"Double,6" json:"Double"` 61 String_ string `thrift:"String,7" json:"String"` 62 ListInt32 []int32 `thrift:"ListInt32,8" json:"ListInt32"` 63 MapStringString map[string]string `thrift:"MapStringString,9" json:"MapStringString"` 64 SetInt32_ []int32 `thrift:"SetInt32,10" json:"SetInt32"` 65 Foo FOO `thrift:"Foo,11" json:"Foo"` 66 MapInt32String map[int32]string `thrift:"MapInt32String,12" json:"MapInt32String"` 67 Binary []byte `thrift:"Binary,13" json:"Binary"` 68 MapInt8String map[int8]string `thrift:"MapInt8String,14" json:"MapInt8String"` 69 MapInt16String map[int16]string `thrift:"MapInt16String,15" json:"MapInt16String"` 70 MapInt64String map[int64]string `thrift:"MapInt64String,16" json:"MapInt64String"` 71 MapDoubleString map[float64]string `thrift:"MapDoubleString,17" json:"MapDoubleString"` 72 ListInnerBase []*InnerBase `thrift:"ListInnerBase,18" json:"ListInnerBase"` 73 MapInnerBaseInnerBase map[*InnerBase]*InnerBase `thrift:"MapInnerBaseInnerBase,19" json:"MapInnerBaseInnerBase"` 74 Base *base.Base `thrift:"Base,255" json:"Base"` 75 } 76 77 func NewInnerBase() *InnerBase { 78 return &InnerBase{} 79 } 80 81 func (p *InnerBase) GetBool() (v bool) { 82 return p.Bool 83 } 84 85 func (p *InnerBase) GetByte() (v int8) { 86 return p.Byte 87 } 88 89 func (p *InnerBase) GetInt16() (v int16) { 90 return p.Int16 91 } 92 93 func (p *InnerBase) GetInt32() (v int32) { 94 return p.Int32 95 } 96 97 func (p *InnerBase) GetInt64() (v int64) { 98 return p.Int64 99 } 100 101 func (p *InnerBase) GetDouble() (v float64) { 102 return p.Double 103 } 104 105 func (p *InnerBase) GetString() (v string) { 106 return p.String_ 107 } 108 109 func (p *InnerBase) GetListInt32() (v []int32) { 110 return p.ListInt32 111 } 112 113 func (p *InnerBase) GetMapStringString() (v map[string]string) { 114 return p.MapStringString 115 } 116 117 func (p *InnerBase) GetSetInt32() (v []int32) { 118 return p.SetInt32_ 119 } 120 121 func (p *InnerBase) GetFoo() (v FOO) { 122 return p.Foo 123 } 124 125 func (p *InnerBase) GetMapInt32String() (v map[int32]string) { 126 return p.MapInt32String 127 } 128 129 func (p *InnerBase) GetBinary() (v []byte) { 130 return p.Binary 131 } 132 133 func (p *InnerBase) GetMapInt8String() (v map[int8]string) { 134 return p.MapInt8String 135 } 136 137 func (p *InnerBase) GetMapInt16String() (v map[int16]string) { 138 return p.MapInt16String 139 } 140 141 func (p *InnerBase) GetMapInt64String() (v map[int64]string) { 142 return p.MapInt64String 143 } 144 145 func (p *InnerBase) GetMapDoubleString() (v map[float64]string) { 146 return p.MapDoubleString 147 } 148 149 func (p *InnerBase) GetListInnerBase() (v []*InnerBase) { 150 return p.ListInnerBase 151 } 152 153 func (p *InnerBase) GetMapInnerBaseInnerBase() (v map[*InnerBase]*InnerBase) { 154 return p.MapInnerBaseInnerBase 155 } 156 157 var InnerBase_Base_DEFAULT *base.Base 158 159 func (p *InnerBase) GetBase() (v *base.Base) { 160 if !p.IsSetBase() { 161 return InnerBase_Base_DEFAULT 162 } 163 return p.Base 164 } 165 func (p *InnerBase) SetBool(val bool) { 166 p.Bool = val 167 } 168 func (p *InnerBase) SetByte(val int8) { 169 p.Byte = val 170 } 171 func (p *InnerBase) SetInt16(val int16) { 172 p.Int16 = val 173 } 174 func (p *InnerBase) SetInt32(val int32) { 175 p.Int32 = val 176 } 177 func (p *InnerBase) SetInt64(val int64) { 178 p.Int64 = val 179 } 180 func (p *InnerBase) SetDouble(val float64) { 181 p.Double = val 182 } 183 func (p *InnerBase) SetString(val string) { 184 p.String_ = val 185 } 186 func (p *InnerBase) SetListInt32(val []int32) { 187 p.ListInt32 = val 188 } 189 func (p *InnerBase) SetMapStringString(val map[string]string) { 190 p.MapStringString = val 191 } 192 func (p *InnerBase) SetSetInt32(val []int32) { 193 p.SetInt32_ = val 194 } 195 func (p *InnerBase) SetFoo(val FOO) { 196 p.Foo = val 197 } 198 func (p *InnerBase) SetMapInt32String(val map[int32]string) { 199 p.MapInt32String = val 200 } 201 func (p *InnerBase) SetBinary(val []byte) { 202 p.Binary = val 203 } 204 func (p *InnerBase) SetMapInt8String(val map[int8]string) { 205 p.MapInt8String = val 206 } 207 func (p *InnerBase) SetMapInt16String(val map[int16]string) { 208 p.MapInt16String = val 209 } 210 func (p *InnerBase) SetMapInt64String(val map[int64]string) { 211 p.MapInt64String = val 212 } 213 func (p *InnerBase) SetMapDoubleString(val map[float64]string) { 214 p.MapDoubleString = val 215 } 216 func (p *InnerBase) SetListInnerBase(val []*InnerBase) { 217 p.ListInnerBase = val 218 } 219 func (p *InnerBase) SetMapInnerBaseInnerBase(val map[*InnerBase]*InnerBase) { 220 p.MapInnerBaseInnerBase = val 221 } 222 func (p *InnerBase) SetBase(val *base.Base) { 223 p.Base = val 224 } 225 226 var fieldIDToName_InnerBase = map[int16]string{ 227 1: "Bool", 228 2: "Byte", 229 3: "Int16", 230 4: "Int32", 231 5: "Int64", 232 6: "Double", 233 7: "String", 234 8: "ListInt32", 235 9: "MapStringString", 236 10: "SetInt32", 237 11: "Foo", 238 12: "MapInt32String", 239 13: "Binary", 240 14: "MapInt8String", 241 15: "MapInt16String", 242 16: "MapInt64String", 243 17: "MapDoubleString", 244 18: "ListInnerBase", 245 19: "MapInnerBaseInnerBase", 246 255: "Base", 247 } 248 249 func (p *InnerBase) IsSetBase() bool { 250 return p.Base != nil 251 } 252 253 func (p *InnerBase) Read(iprot thrift.TProtocol) (err error) { 254 255 var fieldTypeId thrift.TType 256 var fieldId int16 257 258 if _, err = iprot.ReadStructBegin(); err != nil { 259 goto ReadStructBeginError 260 } 261 262 for { 263 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 264 if err != nil { 265 goto ReadFieldBeginError 266 } 267 if fieldTypeId == thrift.STOP { 268 break 269 } 270 271 switch fieldId { 272 case 1: 273 if fieldTypeId == thrift.BOOL { 274 if err = p.ReadField1(iprot); err != nil { 275 goto ReadFieldError 276 } 277 } else { 278 if err = iprot.Skip(fieldTypeId); err != nil { 279 goto SkipFieldError 280 } 281 } 282 case 2: 283 if fieldTypeId == thrift.BYTE { 284 if err = p.ReadField2(iprot); err != nil { 285 goto ReadFieldError 286 } 287 } else { 288 if err = iprot.Skip(fieldTypeId); err != nil { 289 goto SkipFieldError 290 } 291 } 292 case 3: 293 if fieldTypeId == thrift.I16 { 294 if err = p.ReadField3(iprot); err != nil { 295 goto ReadFieldError 296 } 297 } else { 298 if err = iprot.Skip(fieldTypeId); err != nil { 299 goto SkipFieldError 300 } 301 } 302 case 4: 303 if fieldTypeId == thrift.I32 { 304 if err = p.ReadField4(iprot); err != nil { 305 goto ReadFieldError 306 } 307 } else { 308 if err = iprot.Skip(fieldTypeId); err != nil { 309 goto SkipFieldError 310 } 311 } 312 case 5: 313 if fieldTypeId == thrift.I64 { 314 if err = p.ReadField5(iprot); err != nil { 315 goto ReadFieldError 316 } 317 } else { 318 if err = iprot.Skip(fieldTypeId); err != nil { 319 goto SkipFieldError 320 } 321 } 322 case 6: 323 if fieldTypeId == thrift.DOUBLE { 324 if err = p.ReadField6(iprot); err != nil { 325 goto ReadFieldError 326 } 327 } else { 328 if err = iprot.Skip(fieldTypeId); err != nil { 329 goto SkipFieldError 330 } 331 } 332 case 7: 333 if fieldTypeId == thrift.STRING { 334 if err = p.ReadField7(iprot); err != nil { 335 goto ReadFieldError 336 } 337 } else { 338 if err = iprot.Skip(fieldTypeId); err != nil { 339 goto SkipFieldError 340 } 341 } 342 case 8: 343 if fieldTypeId == thrift.LIST { 344 if err = p.ReadField8(iprot); err != nil { 345 goto ReadFieldError 346 } 347 } else { 348 if err = iprot.Skip(fieldTypeId); err != nil { 349 goto SkipFieldError 350 } 351 } 352 case 9: 353 if fieldTypeId == thrift.MAP { 354 if err = p.ReadField9(iprot); err != nil { 355 goto ReadFieldError 356 } 357 } else { 358 if err = iprot.Skip(fieldTypeId); err != nil { 359 goto SkipFieldError 360 } 361 } 362 case 10: 363 if fieldTypeId == thrift.SET { 364 if err = p.ReadField10(iprot); err != nil { 365 goto ReadFieldError 366 } 367 } else { 368 if err = iprot.Skip(fieldTypeId); err != nil { 369 goto SkipFieldError 370 } 371 } 372 case 11: 373 if fieldTypeId == thrift.I32 { 374 if err = p.ReadField11(iprot); err != nil { 375 goto ReadFieldError 376 } 377 } else { 378 if err = iprot.Skip(fieldTypeId); err != nil { 379 goto SkipFieldError 380 } 381 } 382 case 12: 383 if fieldTypeId == thrift.MAP { 384 if err = p.ReadField12(iprot); err != nil { 385 goto ReadFieldError 386 } 387 } else { 388 if err = iprot.Skip(fieldTypeId); err != nil { 389 goto SkipFieldError 390 } 391 } 392 case 13: 393 if fieldTypeId == thrift.STRING { 394 if err = p.ReadField13(iprot); err != nil { 395 goto ReadFieldError 396 } 397 } else { 398 if err = iprot.Skip(fieldTypeId); err != nil { 399 goto SkipFieldError 400 } 401 } 402 case 14: 403 if fieldTypeId == thrift.MAP { 404 if err = p.ReadField14(iprot); err != nil { 405 goto ReadFieldError 406 } 407 } else { 408 if err = iprot.Skip(fieldTypeId); err != nil { 409 goto SkipFieldError 410 } 411 } 412 case 15: 413 if fieldTypeId == thrift.MAP { 414 if err = p.ReadField15(iprot); err != nil { 415 goto ReadFieldError 416 } 417 } else { 418 if err = iprot.Skip(fieldTypeId); err != nil { 419 goto SkipFieldError 420 } 421 } 422 case 16: 423 if fieldTypeId == thrift.MAP { 424 if err = p.ReadField16(iprot); err != nil { 425 goto ReadFieldError 426 } 427 } else { 428 if err = iprot.Skip(fieldTypeId); err != nil { 429 goto SkipFieldError 430 } 431 } 432 case 17: 433 if fieldTypeId == thrift.MAP { 434 if err = p.ReadField17(iprot); err != nil { 435 goto ReadFieldError 436 } 437 } else { 438 if err = iprot.Skip(fieldTypeId); err != nil { 439 goto SkipFieldError 440 } 441 } 442 case 18: 443 if fieldTypeId == thrift.LIST { 444 if err = p.ReadField18(iprot); err != nil { 445 goto ReadFieldError 446 } 447 } else { 448 if err = iprot.Skip(fieldTypeId); err != nil { 449 goto SkipFieldError 450 } 451 } 452 case 19: 453 if fieldTypeId == thrift.MAP { 454 if err = p.ReadField19(iprot); err != nil { 455 goto ReadFieldError 456 } 457 } else { 458 if err = iprot.Skip(fieldTypeId); err != nil { 459 goto SkipFieldError 460 } 461 } 462 case 255: 463 if fieldTypeId == thrift.STRUCT { 464 if err = p.ReadField255(iprot); err != nil { 465 goto ReadFieldError 466 } 467 } else { 468 if err = iprot.Skip(fieldTypeId); err != nil { 469 goto SkipFieldError 470 } 471 } 472 default: 473 if err = iprot.Skip(fieldTypeId); err != nil { 474 goto SkipFieldError 475 } 476 } 477 478 if err = iprot.ReadFieldEnd(); err != nil { 479 goto ReadFieldEndError 480 } 481 } 482 if err = iprot.ReadStructEnd(); err != nil { 483 goto ReadStructEndError 484 } 485 486 return nil 487 ReadStructBeginError: 488 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 489 ReadFieldBeginError: 490 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 491 ReadFieldError: 492 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InnerBase[fieldId]), err) 493 SkipFieldError: 494 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 495 496 ReadFieldEndError: 497 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 498 ReadStructEndError: 499 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 500 } 501 502 func (p *InnerBase) ReadField1(iprot thrift.TProtocol) error { 503 if v, err := iprot.ReadBool(); err != nil { 504 return err 505 } else { 506 p.Bool = v 507 } 508 return nil 509 } 510 511 func (p *InnerBase) ReadField2(iprot thrift.TProtocol) error { 512 if v, err := iprot.ReadByte(); err != nil { 513 return err 514 } else { 515 p.Byte = v 516 } 517 return nil 518 } 519 520 func (p *InnerBase) ReadField3(iprot thrift.TProtocol) error { 521 if v, err := iprot.ReadI16(); err != nil { 522 return err 523 } else { 524 p.Int16 = v 525 } 526 return nil 527 } 528 529 func (p *InnerBase) ReadField4(iprot thrift.TProtocol) error { 530 if v, err := iprot.ReadI32(); err != nil { 531 return err 532 } else { 533 p.Int32 = v 534 } 535 return nil 536 } 537 538 func (p *InnerBase) ReadField5(iprot thrift.TProtocol) error { 539 if v, err := iprot.ReadI64(); err != nil { 540 return err 541 } else { 542 p.Int64 = v 543 } 544 return nil 545 } 546 547 func (p *InnerBase) ReadField6(iprot thrift.TProtocol) error { 548 if v, err := iprot.ReadDouble(); err != nil { 549 return err 550 } else { 551 p.Double = v 552 } 553 return nil 554 } 555 556 func (p *InnerBase) ReadField7(iprot thrift.TProtocol) error { 557 if v, err := iprot.ReadString(); err != nil { 558 return err 559 } else { 560 p.String_ = v 561 } 562 return nil 563 } 564 565 func (p *InnerBase) ReadField8(iprot thrift.TProtocol) error { 566 _, size, err := iprot.ReadListBegin() 567 if err != nil { 568 return err 569 } 570 p.ListInt32 = make([]int32, 0, size) 571 for i := 0; i < size; i++ { 572 var _elem int32 573 if v, err := iprot.ReadI32(); err != nil { 574 return err 575 } else { 576 _elem = v 577 } 578 579 p.ListInt32 = append(p.ListInt32, _elem) 580 } 581 if err := iprot.ReadListEnd(); err != nil { 582 return err 583 } 584 return nil 585 } 586 587 func (p *InnerBase) ReadField9(iprot thrift.TProtocol) error { 588 _, _, size, err := iprot.ReadMapBegin() 589 if err != nil { 590 return err 591 } 592 p.MapStringString = make(map[string]string, size) 593 for i := 0; i < size; i++ { 594 var _key string 595 if v, err := iprot.ReadString(); err != nil { 596 return err 597 } else { 598 _key = v 599 } 600 601 var _val string 602 if v, err := iprot.ReadString(); err != nil { 603 return err 604 } else { 605 _val = v 606 } 607 608 p.MapStringString[_key] = _val 609 } 610 if err := iprot.ReadMapEnd(); err != nil { 611 return err 612 } 613 return nil 614 } 615 616 func (p *InnerBase) ReadField10(iprot thrift.TProtocol) error { 617 _, size, err := iprot.ReadSetBegin() 618 if err != nil { 619 return err 620 } 621 p.SetInt32_ = make([]int32, 0, size) 622 for i := 0; i < size; i++ { 623 var _elem int32 624 if v, err := iprot.ReadI32(); err != nil { 625 return err 626 } else { 627 _elem = v 628 } 629 630 p.SetInt32_ = append(p.SetInt32_, _elem) 631 } 632 if err := iprot.ReadSetEnd(); err != nil { 633 return err 634 } 635 return nil 636 } 637 638 func (p *InnerBase) ReadField11(iprot thrift.TProtocol) error { 639 if v, err := iprot.ReadI32(); err != nil { 640 return err 641 } else { 642 p.Foo = FOO(v) 643 } 644 return nil 645 } 646 647 func (p *InnerBase) ReadField12(iprot thrift.TProtocol) error { 648 _, _, size, err := iprot.ReadMapBegin() 649 if err != nil { 650 return err 651 } 652 p.MapInt32String = make(map[int32]string, size) 653 for i := 0; i < size; i++ { 654 var _key int32 655 if v, err := iprot.ReadI32(); err != nil { 656 return err 657 } else { 658 _key = v 659 } 660 661 var _val string 662 if v, err := iprot.ReadString(); err != nil { 663 return err 664 } else { 665 _val = v 666 } 667 668 p.MapInt32String[_key] = _val 669 } 670 if err := iprot.ReadMapEnd(); err != nil { 671 return err 672 } 673 return nil 674 } 675 676 func (p *InnerBase) ReadField13(iprot thrift.TProtocol) error { 677 if v, err := iprot.ReadBinary(); err != nil { 678 return err 679 } else { 680 p.Binary = []byte(v) 681 } 682 return nil 683 } 684 685 func (p *InnerBase) ReadField14(iprot thrift.TProtocol) error { 686 _, _, size, err := iprot.ReadMapBegin() 687 if err != nil { 688 return err 689 } 690 p.MapInt8String = make(map[int8]string, size) 691 for i := 0; i < size; i++ { 692 var _key int8 693 if v, err := iprot.ReadByte(); err != nil { 694 return err 695 } else { 696 _key = v 697 } 698 699 var _val string 700 if v, err := iprot.ReadString(); err != nil { 701 return err 702 } else { 703 _val = v 704 } 705 706 p.MapInt8String[_key] = _val 707 } 708 if err := iprot.ReadMapEnd(); err != nil { 709 return err 710 } 711 return nil 712 } 713 714 func (p *InnerBase) ReadField15(iprot thrift.TProtocol) error { 715 _, _, size, err := iprot.ReadMapBegin() 716 if err != nil { 717 return err 718 } 719 p.MapInt16String = make(map[int16]string, size) 720 for i := 0; i < size; i++ { 721 var _key int16 722 if v, err := iprot.ReadI16(); err != nil { 723 return err 724 } else { 725 _key = v 726 } 727 728 var _val string 729 if v, err := iprot.ReadString(); err != nil { 730 return err 731 } else { 732 _val = v 733 } 734 735 p.MapInt16String[_key] = _val 736 } 737 if err := iprot.ReadMapEnd(); err != nil { 738 return err 739 } 740 return nil 741 } 742 743 func (p *InnerBase) ReadField16(iprot thrift.TProtocol) error { 744 _, _, size, err := iprot.ReadMapBegin() 745 if err != nil { 746 return err 747 } 748 p.MapInt64String = make(map[int64]string, size) 749 for i := 0; i < size; i++ { 750 var _key int64 751 if v, err := iprot.ReadI64(); err != nil { 752 return err 753 } else { 754 _key = v 755 } 756 757 var _val string 758 if v, err := iprot.ReadString(); err != nil { 759 return err 760 } else { 761 _val = v 762 } 763 764 p.MapInt64String[_key] = _val 765 } 766 if err := iprot.ReadMapEnd(); err != nil { 767 return err 768 } 769 return nil 770 } 771 772 func (p *InnerBase) ReadField17(iprot thrift.TProtocol) error { 773 _, _, size, err := iprot.ReadMapBegin() 774 if err != nil { 775 return err 776 } 777 p.MapDoubleString = make(map[float64]string, size) 778 for i := 0; i < size; i++ { 779 var _key float64 780 if v, err := iprot.ReadDouble(); err != nil { 781 return err 782 } else { 783 _key = v 784 } 785 786 var _val string 787 if v, err := iprot.ReadString(); err != nil { 788 return err 789 } else { 790 _val = v 791 } 792 793 p.MapDoubleString[_key] = _val 794 } 795 if err := iprot.ReadMapEnd(); err != nil { 796 return err 797 } 798 return nil 799 } 800 801 func (p *InnerBase) ReadField18(iprot thrift.TProtocol) error { 802 _, size, err := iprot.ReadListBegin() 803 if err != nil { 804 return err 805 } 806 p.ListInnerBase = make([]*InnerBase, 0, size) 807 for i := 0; i < size; i++ { 808 _elem := NewInnerBase() 809 if err := _elem.Read(iprot); err != nil { 810 return err 811 } 812 813 p.ListInnerBase = append(p.ListInnerBase, _elem) 814 } 815 if err := iprot.ReadListEnd(); err != nil { 816 return err 817 } 818 return nil 819 } 820 821 func (p *InnerBase) ReadField19(iprot thrift.TProtocol) error { 822 _, _, size, err := iprot.ReadMapBegin() 823 if err != nil { 824 return err 825 } 826 p.MapInnerBaseInnerBase = make(map[*InnerBase]*InnerBase, size) 827 for i := 0; i < size; i++ { 828 _key := NewInnerBase() 829 if err := _key.Read(iprot); err != nil { 830 return err 831 } 832 _val := NewInnerBase() 833 if err := _val.Read(iprot); err != nil { 834 return err 835 } 836 837 p.MapInnerBaseInnerBase[_key] = _val 838 } 839 if err := iprot.ReadMapEnd(); err != nil { 840 return err 841 } 842 return nil 843 } 844 845 func (p *InnerBase) ReadField255(iprot thrift.TProtocol) error { 846 p.Base = base.NewBase() 847 if err := p.Base.Read(iprot); err != nil { 848 return err 849 } 850 return nil 851 } 852 853 func (p *InnerBase) Write(oprot thrift.TProtocol) (err error) { 854 var fieldId int16 855 if err = oprot.WriteStructBegin("InnerBase"); err != nil { 856 goto WriteStructBeginError 857 } 858 if p != nil { 859 if err = p.writeField1(oprot); err != nil { 860 fieldId = 1 861 goto WriteFieldError 862 } 863 if err = p.writeField2(oprot); err != nil { 864 fieldId = 2 865 goto WriteFieldError 866 } 867 if err = p.writeField3(oprot); err != nil { 868 fieldId = 3 869 goto WriteFieldError 870 } 871 if err = p.writeField4(oprot); err != nil { 872 fieldId = 4 873 goto WriteFieldError 874 } 875 if err = p.writeField5(oprot); err != nil { 876 fieldId = 5 877 goto WriteFieldError 878 } 879 if err = p.writeField6(oprot); err != nil { 880 fieldId = 6 881 goto WriteFieldError 882 } 883 if err = p.writeField7(oprot); err != nil { 884 fieldId = 7 885 goto WriteFieldError 886 } 887 if err = p.writeField8(oprot); err != nil { 888 fieldId = 8 889 goto WriteFieldError 890 } 891 if err = p.writeField9(oprot); err != nil { 892 fieldId = 9 893 goto WriteFieldError 894 } 895 if err = p.writeField10(oprot); err != nil { 896 fieldId = 10 897 goto WriteFieldError 898 } 899 if err = p.writeField11(oprot); err != nil { 900 fieldId = 11 901 goto WriteFieldError 902 } 903 if err = p.writeField12(oprot); err != nil { 904 fieldId = 12 905 goto WriteFieldError 906 } 907 if err = p.writeField13(oprot); err != nil { 908 fieldId = 13 909 goto WriteFieldError 910 } 911 if err = p.writeField14(oprot); err != nil { 912 fieldId = 14 913 goto WriteFieldError 914 } 915 if err = p.writeField15(oprot); err != nil { 916 fieldId = 15 917 goto WriteFieldError 918 } 919 if err = p.writeField16(oprot); err != nil { 920 fieldId = 16 921 goto WriteFieldError 922 } 923 if err = p.writeField17(oprot); err != nil { 924 fieldId = 17 925 goto WriteFieldError 926 } 927 if err = p.writeField18(oprot); err != nil { 928 fieldId = 18 929 goto WriteFieldError 930 } 931 if err = p.writeField19(oprot); err != nil { 932 fieldId = 19 933 goto WriteFieldError 934 } 935 if err = p.writeField255(oprot); err != nil { 936 fieldId = 255 937 goto WriteFieldError 938 } 939 940 } 941 if err = oprot.WriteFieldStop(); err != nil { 942 goto WriteFieldStopError 943 } 944 if err = oprot.WriteStructEnd(); err != nil { 945 goto WriteStructEndError 946 } 947 return nil 948 WriteStructBeginError: 949 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 950 WriteFieldError: 951 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 952 WriteFieldStopError: 953 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 954 WriteStructEndError: 955 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 956 } 957 958 func (p *InnerBase) writeField1(oprot thrift.TProtocol) (err error) { 959 if err = oprot.WriteFieldBegin("Bool", thrift.BOOL, 1); err != nil { 960 goto WriteFieldBeginError 961 } 962 if err := oprot.WriteBool(p.Bool); err != nil { 963 return err 964 } 965 if err = oprot.WriteFieldEnd(); err != nil { 966 goto WriteFieldEndError 967 } 968 return nil 969 WriteFieldBeginError: 970 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 971 WriteFieldEndError: 972 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 973 } 974 975 func (p *InnerBase) writeField2(oprot thrift.TProtocol) (err error) { 976 if err = oprot.WriteFieldBegin("Byte", thrift.BYTE, 2); err != nil { 977 goto WriteFieldBeginError 978 } 979 if err := oprot.WriteByte(p.Byte); err != nil { 980 return err 981 } 982 if err = oprot.WriteFieldEnd(); err != nil { 983 goto WriteFieldEndError 984 } 985 return nil 986 WriteFieldBeginError: 987 return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) 988 WriteFieldEndError: 989 return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) 990 } 991 992 func (p *InnerBase) writeField3(oprot thrift.TProtocol) (err error) { 993 if err = oprot.WriteFieldBegin("Int16", thrift.I16, 3); err != nil { 994 goto WriteFieldBeginError 995 } 996 if err := oprot.WriteI16(p.Int16); err != nil { 997 return err 998 } 999 if err = oprot.WriteFieldEnd(); err != nil { 1000 goto WriteFieldEndError 1001 } 1002 return nil 1003 WriteFieldBeginError: 1004 return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) 1005 WriteFieldEndError: 1006 return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) 1007 } 1008 1009 func (p *InnerBase) writeField4(oprot thrift.TProtocol) (err error) { 1010 if err = oprot.WriteFieldBegin("Int32", thrift.I32, 4); err != nil { 1011 goto WriteFieldBeginError 1012 } 1013 if err := oprot.WriteI32(p.Int32); err != nil { 1014 return err 1015 } 1016 if err = oprot.WriteFieldEnd(); err != nil { 1017 goto WriteFieldEndError 1018 } 1019 return nil 1020 WriteFieldBeginError: 1021 return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) 1022 WriteFieldEndError: 1023 return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) 1024 } 1025 1026 func (p *InnerBase) writeField5(oprot thrift.TProtocol) (err error) { 1027 if err = oprot.WriteFieldBegin("Int64", thrift.I64, 5); err != nil { 1028 goto WriteFieldBeginError 1029 } 1030 if err := oprot.WriteI64(p.Int64); err != nil { 1031 return err 1032 } 1033 if err = oprot.WriteFieldEnd(); err != nil { 1034 goto WriteFieldEndError 1035 } 1036 return nil 1037 WriteFieldBeginError: 1038 return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) 1039 WriteFieldEndError: 1040 return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) 1041 } 1042 1043 func (p *InnerBase) writeField6(oprot thrift.TProtocol) (err error) { 1044 if err = oprot.WriteFieldBegin("Double", thrift.DOUBLE, 6); err != nil { 1045 goto WriteFieldBeginError 1046 } 1047 if err := oprot.WriteDouble(p.Double); err != nil { 1048 return err 1049 } 1050 if err = oprot.WriteFieldEnd(); err != nil { 1051 goto WriteFieldEndError 1052 } 1053 return nil 1054 WriteFieldBeginError: 1055 return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) 1056 WriteFieldEndError: 1057 return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) 1058 } 1059 1060 func (p *InnerBase) writeField7(oprot thrift.TProtocol) (err error) { 1061 if err = oprot.WriteFieldBegin("String", thrift.STRING, 7); err != nil { 1062 goto WriteFieldBeginError 1063 } 1064 if err := oprot.WriteString(p.String_); err != nil { 1065 return err 1066 } 1067 if err = oprot.WriteFieldEnd(); err != nil { 1068 goto WriteFieldEndError 1069 } 1070 return nil 1071 WriteFieldBeginError: 1072 return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) 1073 WriteFieldEndError: 1074 return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) 1075 } 1076 1077 func (p *InnerBase) writeField8(oprot thrift.TProtocol) (err error) { 1078 if err = oprot.WriteFieldBegin("ListInt32", thrift.LIST, 8); err != nil { 1079 goto WriteFieldBeginError 1080 } 1081 if err := oprot.WriteListBegin(thrift.I32, len(p.ListInt32)); err != nil { 1082 return err 1083 } 1084 for _, v := range p.ListInt32 { 1085 if err := oprot.WriteI32(v); err != nil { 1086 return err 1087 } 1088 } 1089 if err := oprot.WriteListEnd(); err != nil { 1090 return err 1091 } 1092 if err = oprot.WriteFieldEnd(); err != nil { 1093 goto WriteFieldEndError 1094 } 1095 return nil 1096 WriteFieldBeginError: 1097 return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) 1098 WriteFieldEndError: 1099 return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) 1100 } 1101 1102 func (p *InnerBase) writeField9(oprot thrift.TProtocol) (err error) { 1103 if err = oprot.WriteFieldBegin("MapStringString", thrift.MAP, 9); err != nil { 1104 goto WriteFieldBeginError 1105 } 1106 if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.MapStringString)); err != nil { 1107 return err 1108 } 1109 for k, v := range p.MapStringString { 1110 1111 if err := oprot.WriteString(k); err != nil { 1112 return err 1113 } 1114 1115 if err := oprot.WriteString(v); err != nil { 1116 return err 1117 } 1118 } 1119 if err := oprot.WriteMapEnd(); err != nil { 1120 return err 1121 } 1122 if err = oprot.WriteFieldEnd(); err != nil { 1123 goto WriteFieldEndError 1124 } 1125 return nil 1126 WriteFieldBeginError: 1127 return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) 1128 WriteFieldEndError: 1129 return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) 1130 } 1131 1132 func (p *InnerBase) writeField10(oprot thrift.TProtocol) (err error) { 1133 if err = oprot.WriteFieldBegin("SetInt32", thrift.SET, 10); err != nil { 1134 goto WriteFieldBeginError 1135 } 1136 if err := oprot.WriteSetBegin(thrift.I32, len(p.SetInt32_)); err != nil { 1137 return err 1138 } 1139 for i := 0; i < len(p.SetInt32_); i++ { 1140 for j := i + 1; j < len(p.SetInt32_); j++ { 1141 if func(tgt, src int32) bool { 1142 if tgt != src { 1143 return false 1144 } 1145 return true 1146 }(p.SetInt32_[i], p.SetInt32_[j]) { 1147 return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.SetInt32_[i])) 1148 } 1149 } 1150 } 1151 for _, v := range p.SetInt32_ { 1152 if err := oprot.WriteI32(v); err != nil { 1153 return err 1154 } 1155 } 1156 if err := oprot.WriteSetEnd(); err != nil { 1157 return err 1158 } 1159 if err = oprot.WriteFieldEnd(); err != nil { 1160 goto WriteFieldEndError 1161 } 1162 return nil 1163 WriteFieldBeginError: 1164 return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) 1165 WriteFieldEndError: 1166 return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) 1167 } 1168 1169 func (p *InnerBase) writeField11(oprot thrift.TProtocol) (err error) { 1170 if err = oprot.WriteFieldBegin("Foo", thrift.I32, 11); err != nil { 1171 goto WriteFieldBeginError 1172 } 1173 if err := oprot.WriteI32(int32(p.Foo)); err != nil { 1174 return err 1175 } 1176 if err = oprot.WriteFieldEnd(); err != nil { 1177 goto WriteFieldEndError 1178 } 1179 return nil 1180 WriteFieldBeginError: 1181 return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) 1182 WriteFieldEndError: 1183 return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) 1184 } 1185 1186 func (p *InnerBase) writeField12(oprot thrift.TProtocol) (err error) { 1187 if err = oprot.WriteFieldBegin("MapInt32String", thrift.MAP, 12); err != nil { 1188 goto WriteFieldBeginError 1189 } 1190 if err := oprot.WriteMapBegin(thrift.I32, thrift.STRING, len(p.MapInt32String)); err != nil { 1191 return err 1192 } 1193 for k, v := range p.MapInt32String { 1194 1195 if err := oprot.WriteI32(k); err != nil { 1196 return err 1197 } 1198 1199 if err := oprot.WriteString(v); err != nil { 1200 return err 1201 } 1202 } 1203 if err := oprot.WriteMapEnd(); err != nil { 1204 return err 1205 } 1206 if err = oprot.WriteFieldEnd(); err != nil { 1207 goto WriteFieldEndError 1208 } 1209 return nil 1210 WriteFieldBeginError: 1211 return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) 1212 WriteFieldEndError: 1213 return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) 1214 } 1215 1216 func (p *InnerBase) writeField13(oprot thrift.TProtocol) (err error) { 1217 if err = oprot.WriteFieldBegin("Binary", thrift.STRING, 13); err != nil { 1218 goto WriteFieldBeginError 1219 } 1220 if err := oprot.WriteBinary([]byte(p.Binary)); err != nil { 1221 return err 1222 } 1223 if err = oprot.WriteFieldEnd(); err != nil { 1224 goto WriteFieldEndError 1225 } 1226 return nil 1227 WriteFieldBeginError: 1228 return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) 1229 WriteFieldEndError: 1230 return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) 1231 } 1232 1233 func (p *InnerBase) writeField14(oprot thrift.TProtocol) (err error) { 1234 if err = oprot.WriteFieldBegin("MapInt8String", thrift.MAP, 14); err != nil { 1235 goto WriteFieldBeginError 1236 } 1237 if err := oprot.WriteMapBegin(thrift.BYTE, thrift.STRING, len(p.MapInt8String)); err != nil { 1238 return err 1239 } 1240 for k, v := range p.MapInt8String { 1241 1242 if err := oprot.WriteByte(k); err != nil { 1243 return err 1244 } 1245 1246 if err := oprot.WriteString(v); err != nil { 1247 return err 1248 } 1249 } 1250 if err := oprot.WriteMapEnd(); err != nil { 1251 return err 1252 } 1253 if err = oprot.WriteFieldEnd(); err != nil { 1254 goto WriteFieldEndError 1255 } 1256 return nil 1257 WriteFieldBeginError: 1258 return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) 1259 WriteFieldEndError: 1260 return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) 1261 } 1262 1263 func (p *InnerBase) writeField15(oprot thrift.TProtocol) (err error) { 1264 if err = oprot.WriteFieldBegin("MapInt16String", thrift.MAP, 15); err != nil { 1265 goto WriteFieldBeginError 1266 } 1267 if err := oprot.WriteMapBegin(thrift.I16, thrift.STRING, len(p.MapInt16String)); err != nil { 1268 return err 1269 } 1270 for k, v := range p.MapInt16String { 1271 1272 if err := oprot.WriteI16(k); err != nil { 1273 return err 1274 } 1275 1276 if err := oprot.WriteString(v); err != nil { 1277 return err 1278 } 1279 } 1280 if err := oprot.WriteMapEnd(); err != nil { 1281 return err 1282 } 1283 if err = oprot.WriteFieldEnd(); err != nil { 1284 goto WriteFieldEndError 1285 } 1286 return nil 1287 WriteFieldBeginError: 1288 return thrift.PrependError(fmt.Sprintf("%T write field 15 begin error: ", p), err) 1289 WriteFieldEndError: 1290 return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err) 1291 } 1292 1293 func (p *InnerBase) writeField16(oprot thrift.TProtocol) (err error) { 1294 if err = oprot.WriteFieldBegin("MapInt64String", thrift.MAP, 16); err != nil { 1295 goto WriteFieldBeginError 1296 } 1297 if err := oprot.WriteMapBegin(thrift.I64, thrift.STRING, len(p.MapInt64String)); err != nil { 1298 return err 1299 } 1300 for k, v := range p.MapInt64String { 1301 1302 if err := oprot.WriteI64(k); err != nil { 1303 return err 1304 } 1305 1306 if err := oprot.WriteString(v); err != nil { 1307 return err 1308 } 1309 } 1310 if err := oprot.WriteMapEnd(); err != nil { 1311 return err 1312 } 1313 if err = oprot.WriteFieldEnd(); err != nil { 1314 goto WriteFieldEndError 1315 } 1316 return nil 1317 WriteFieldBeginError: 1318 return thrift.PrependError(fmt.Sprintf("%T write field 16 begin error: ", p), err) 1319 WriteFieldEndError: 1320 return thrift.PrependError(fmt.Sprintf("%T write field 16 end error: ", p), err) 1321 } 1322 1323 func (p *InnerBase) writeField17(oprot thrift.TProtocol) (err error) { 1324 if err = oprot.WriteFieldBegin("MapDoubleString", thrift.MAP, 17); err != nil { 1325 goto WriteFieldBeginError 1326 } 1327 if err := oprot.WriteMapBegin(thrift.DOUBLE, thrift.STRING, len(p.MapDoubleString)); err != nil { 1328 return err 1329 } 1330 for k, v := range p.MapDoubleString { 1331 1332 if err := oprot.WriteDouble(k); err != nil { 1333 return err 1334 } 1335 1336 if err := oprot.WriteString(v); err != nil { 1337 return err 1338 } 1339 } 1340 if err := oprot.WriteMapEnd(); err != nil { 1341 return err 1342 } 1343 if err = oprot.WriteFieldEnd(); err != nil { 1344 goto WriteFieldEndError 1345 } 1346 return nil 1347 WriteFieldBeginError: 1348 return thrift.PrependError(fmt.Sprintf("%T write field 17 begin error: ", p), err) 1349 WriteFieldEndError: 1350 return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err) 1351 } 1352 1353 func (p *InnerBase) writeField18(oprot thrift.TProtocol) (err error) { 1354 if err = oprot.WriteFieldBegin("ListInnerBase", thrift.LIST, 18); err != nil { 1355 goto WriteFieldBeginError 1356 } 1357 if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ListInnerBase)); err != nil { 1358 return err 1359 } 1360 for _, v := range p.ListInnerBase { 1361 if err := v.Write(oprot); err != nil { 1362 return err 1363 } 1364 } 1365 if err := oprot.WriteListEnd(); err != nil { 1366 return err 1367 } 1368 if err = oprot.WriteFieldEnd(); err != nil { 1369 goto WriteFieldEndError 1370 } 1371 return nil 1372 WriteFieldBeginError: 1373 return thrift.PrependError(fmt.Sprintf("%T write field 18 begin error: ", p), err) 1374 WriteFieldEndError: 1375 return thrift.PrependError(fmt.Sprintf("%T write field 18 end error: ", p), err) 1376 } 1377 1378 func (p *InnerBase) writeField19(oprot thrift.TProtocol) (err error) { 1379 if err = oprot.WriteFieldBegin("MapInnerBaseInnerBase", thrift.MAP, 19); err != nil { 1380 goto WriteFieldBeginError 1381 } 1382 if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.STRUCT, len(p.MapInnerBaseInnerBase)); err != nil { 1383 return err 1384 } 1385 for k, v := range p.MapInnerBaseInnerBase { 1386 1387 if err := k.Write(oprot); err != nil { 1388 return err 1389 } 1390 1391 if err := v.Write(oprot); err != nil { 1392 return err 1393 } 1394 } 1395 if err := oprot.WriteMapEnd(); err != nil { 1396 return err 1397 } 1398 if err = oprot.WriteFieldEnd(); err != nil { 1399 goto WriteFieldEndError 1400 } 1401 return nil 1402 WriteFieldBeginError: 1403 return thrift.PrependError(fmt.Sprintf("%T write field 19 begin error: ", p), err) 1404 WriteFieldEndError: 1405 return thrift.PrependError(fmt.Sprintf("%T write field 19 end error: ", p), err) 1406 } 1407 1408 func (p *InnerBase) writeField255(oprot thrift.TProtocol) (err error) { 1409 if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { 1410 goto WriteFieldBeginError 1411 } 1412 if err := p.Base.Write(oprot); err != nil { 1413 return err 1414 } 1415 if err = oprot.WriteFieldEnd(); err != nil { 1416 goto WriteFieldEndError 1417 } 1418 return nil 1419 WriteFieldBeginError: 1420 return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) 1421 WriteFieldEndError: 1422 return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) 1423 } 1424 1425 func (p *InnerBase) String() string { 1426 if p == nil { 1427 return "<nil>" 1428 } 1429 return fmt.Sprintf("InnerBase(%+v)", *p) 1430 } 1431 1432 func (p *InnerBase) DeepEqual(ano *InnerBase) bool { 1433 if p == ano { 1434 return true 1435 } else if p == nil || ano == nil { 1436 return false 1437 } 1438 if !p.Field1DeepEqual(ano.Bool) { 1439 return false 1440 } 1441 if !p.Field2DeepEqual(ano.Byte) { 1442 return false 1443 } 1444 if !p.Field3DeepEqual(ano.Int16) { 1445 return false 1446 } 1447 if !p.Field4DeepEqual(ano.Int32) { 1448 return false 1449 } 1450 if !p.Field5DeepEqual(ano.Int64) { 1451 return false 1452 } 1453 if !p.Field6DeepEqual(ano.Double) { 1454 return false 1455 } 1456 if !p.Field7DeepEqual(ano.String_) { 1457 return false 1458 } 1459 if !p.Field8DeepEqual(ano.ListInt32) { 1460 return false 1461 } 1462 if !p.Field9DeepEqual(ano.MapStringString) { 1463 return false 1464 } 1465 if !p.Field10DeepEqual(ano.SetInt32_) { 1466 return false 1467 } 1468 if !p.Field11DeepEqual(ano.Foo) { 1469 return false 1470 } 1471 if !p.Field12DeepEqual(ano.MapInt32String) { 1472 return false 1473 } 1474 if !p.Field13DeepEqual(ano.Binary) { 1475 return false 1476 } 1477 if !p.Field14DeepEqual(ano.MapInt8String) { 1478 return false 1479 } 1480 if !p.Field15DeepEqual(ano.MapInt16String) { 1481 return false 1482 } 1483 if !p.Field16DeepEqual(ano.MapInt64String) { 1484 return false 1485 } 1486 if !p.Field17DeepEqual(ano.MapDoubleString) { 1487 return false 1488 } 1489 if !p.Field18DeepEqual(ano.ListInnerBase) { 1490 return false 1491 } 1492 if !p.Field19DeepEqual(ano.MapInnerBaseInnerBase) { 1493 return false 1494 } 1495 if !p.Field255DeepEqual(ano.Base) { 1496 return false 1497 } 1498 return true 1499 } 1500 1501 func (p *InnerBase) Field1DeepEqual(src bool) bool { 1502 1503 if p.Bool != src { 1504 return false 1505 } 1506 return true 1507 } 1508 func (p *InnerBase) Field2DeepEqual(src int8) bool { 1509 1510 if p.Byte != src { 1511 return false 1512 } 1513 return true 1514 } 1515 func (p *InnerBase) Field3DeepEqual(src int16) bool { 1516 1517 if p.Int16 != src { 1518 return false 1519 } 1520 return true 1521 } 1522 func (p *InnerBase) Field4DeepEqual(src int32) bool { 1523 1524 if p.Int32 != src { 1525 return false 1526 } 1527 return true 1528 } 1529 func (p *InnerBase) Field5DeepEqual(src int64) bool { 1530 1531 if p.Int64 != src { 1532 return false 1533 } 1534 return true 1535 } 1536 func (p *InnerBase) Field6DeepEqual(src float64) bool { 1537 1538 if p.Double != src { 1539 return false 1540 } 1541 return true 1542 } 1543 func (p *InnerBase) Field7DeepEqual(src string) bool { 1544 1545 if strings.Compare(p.String_, src) != 0 { 1546 return false 1547 } 1548 return true 1549 } 1550 func (p *InnerBase) Field8DeepEqual(src []int32) bool { 1551 1552 if len(p.ListInt32) != len(src) { 1553 return false 1554 } 1555 for i, v := range p.ListInt32 { 1556 _src := src[i] 1557 if v != _src { 1558 return false 1559 } 1560 } 1561 return true 1562 } 1563 func (p *InnerBase) Field9DeepEqual(src map[string]string) bool { 1564 1565 if len(p.MapStringString) != len(src) { 1566 return false 1567 } 1568 for k, v := range p.MapStringString { 1569 _src := src[k] 1570 if strings.Compare(v, _src) != 0 { 1571 return false 1572 } 1573 } 1574 return true 1575 } 1576 func (p *InnerBase) Field10DeepEqual(src []int32) bool { 1577 1578 if len(p.SetInt32_) != len(src) { 1579 return false 1580 } 1581 for i, v := range p.SetInt32_ { 1582 _src := src[i] 1583 if v != _src { 1584 return false 1585 } 1586 } 1587 return true 1588 } 1589 func (p *InnerBase) Field11DeepEqual(src FOO) bool { 1590 1591 if p.Foo != src { 1592 return false 1593 } 1594 return true 1595 } 1596 func (p *InnerBase) Field12DeepEqual(src map[int32]string) bool { 1597 1598 if len(p.MapInt32String) != len(src) { 1599 return false 1600 } 1601 for k, v := range p.MapInt32String { 1602 _src := src[k] 1603 if strings.Compare(v, _src) != 0 { 1604 return false 1605 } 1606 } 1607 return true 1608 } 1609 func (p *InnerBase) Field13DeepEqual(src []byte) bool { 1610 1611 if bytes.Compare(p.Binary, src) != 0 { 1612 return false 1613 } 1614 return true 1615 } 1616 func (p *InnerBase) Field14DeepEqual(src map[int8]string) bool { 1617 1618 if len(p.MapInt8String) != len(src) { 1619 return false 1620 } 1621 for k, v := range p.MapInt8String { 1622 _src := src[k] 1623 if strings.Compare(v, _src) != 0 { 1624 return false 1625 } 1626 } 1627 return true 1628 } 1629 func (p *InnerBase) Field15DeepEqual(src map[int16]string) bool { 1630 1631 if len(p.MapInt16String) != len(src) { 1632 return false 1633 } 1634 for k, v := range p.MapInt16String { 1635 _src := src[k] 1636 if strings.Compare(v, _src) != 0 { 1637 return false 1638 } 1639 } 1640 return true 1641 } 1642 func (p *InnerBase) Field16DeepEqual(src map[int64]string) bool { 1643 1644 if len(p.MapInt64String) != len(src) { 1645 return false 1646 } 1647 for k, v := range p.MapInt64String { 1648 _src := src[k] 1649 if strings.Compare(v, _src) != 0 { 1650 return false 1651 } 1652 } 1653 return true 1654 } 1655 func (p *InnerBase) Field17DeepEqual(src map[float64]string) bool { 1656 1657 if len(p.MapDoubleString) != len(src) { 1658 return false 1659 } 1660 for k, v := range p.MapDoubleString { 1661 _src := src[k] 1662 if strings.Compare(v, _src) != 0 { 1663 return false 1664 } 1665 } 1666 return true 1667 } 1668 func (p *InnerBase) Field18DeepEqual(src []*InnerBase) bool { 1669 1670 if len(p.ListInnerBase) != len(src) { 1671 return false 1672 } 1673 for i, v := range p.ListInnerBase { 1674 _src := src[i] 1675 if !v.DeepEqual(_src) { 1676 return false 1677 } 1678 } 1679 return true 1680 } 1681 func (p *InnerBase) Field19DeepEqual(src map[*InnerBase]*InnerBase) bool { 1682 1683 if len(p.MapInnerBaseInnerBase) != len(src) { 1684 return false 1685 } 1686 for k, v := range p.MapInnerBaseInnerBase { 1687 _src := src[k] 1688 if !v.DeepEqual(_src) { 1689 return false 1690 } 1691 } 1692 return true 1693 } 1694 func (p *InnerBase) Field255DeepEqual(src *base.Base) bool { 1695 1696 if !p.Base.DeepEqual(src) { 1697 return false 1698 } 1699 return true 1700 } 1701 1702 type InnerBasePartial struct { 1703 Bool bool `thrift:"Bool,1" json:"Bool"` 1704 ListInt32 []int32 `thrift:"ListInt32,8" json:"ListInt32"` 1705 MapStringString map[string]string `thrift:"MapStringString,9" json:"MapStringString"` 1706 MapDoubleString map[float64]string `thrift:"MapDoubleString,17" json:"MapDoubleString"` 1707 ListInnerBase []*InnerBasePartial `thrift:"ListInnerBase,18" json:"ListInnerBase"` 1708 MapInnerBaseInnerBase map[*InnerBasePartial]*InnerBasePartial `thrift:"MapInnerBaseInnerBase,19" json:"MapInnerBaseInnerBase"` 1709 MapStringString2 map[string]string `thrift:"MapStringString2,127" json:"MapStringString2"` 1710 } 1711 1712 func NewInnerBasePartial() *InnerBasePartial { 1713 return &InnerBasePartial{} 1714 } 1715 1716 func (p *InnerBasePartial) GetBool() (v bool) { 1717 return p.Bool 1718 } 1719 1720 func (p *InnerBasePartial) GetListInt32() (v []int32) { 1721 return p.ListInt32 1722 } 1723 1724 func (p *InnerBasePartial) GetMapStringString() (v map[string]string) { 1725 return p.MapStringString 1726 } 1727 1728 func (p *InnerBasePartial) GetMapDoubleString() (v map[float64]string) { 1729 return p.MapDoubleString 1730 } 1731 1732 func (p *InnerBasePartial) GetListInnerBase() (v []*InnerBasePartial) { 1733 return p.ListInnerBase 1734 } 1735 1736 func (p *InnerBasePartial) GetMapInnerBaseInnerBase() (v map[*InnerBasePartial]*InnerBasePartial) { 1737 return p.MapInnerBaseInnerBase 1738 } 1739 1740 func (p *InnerBasePartial) GetMapStringString2() (v map[string]string) { 1741 return p.MapStringString2 1742 } 1743 func (p *InnerBasePartial) SetBool(val bool) { 1744 p.Bool = val 1745 } 1746 func (p *InnerBasePartial) SetListInt32(val []int32) { 1747 p.ListInt32 = val 1748 } 1749 func (p *InnerBasePartial) SetMapStringString(val map[string]string) { 1750 p.MapStringString = val 1751 } 1752 func (p *InnerBasePartial) SetMapDoubleString(val map[float64]string) { 1753 p.MapDoubleString = val 1754 } 1755 func (p *InnerBasePartial) SetListInnerBase(val []*InnerBasePartial) { 1756 p.ListInnerBase = val 1757 } 1758 func (p *InnerBasePartial) SetMapInnerBaseInnerBase(val map[*InnerBasePartial]*InnerBasePartial) { 1759 p.MapInnerBaseInnerBase = val 1760 } 1761 func (p *InnerBasePartial) SetMapStringString2(val map[string]string) { 1762 p.MapStringString2 = val 1763 } 1764 1765 var fieldIDToName_InnerBasePartial = map[int16]string{ 1766 1: "Bool", 1767 8: "ListInt32", 1768 9: "MapStringString", 1769 17: "MapDoubleString", 1770 18: "ListInnerBase", 1771 19: "MapInnerBaseInnerBase", 1772 127: "MapStringString2", 1773 } 1774 1775 func (p *InnerBasePartial) Read(iprot thrift.TProtocol) (err error) { 1776 1777 var fieldTypeId thrift.TType 1778 var fieldId int16 1779 1780 if _, err = iprot.ReadStructBegin(); err != nil { 1781 goto ReadStructBeginError 1782 } 1783 1784 for { 1785 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 1786 if err != nil { 1787 goto ReadFieldBeginError 1788 } 1789 if fieldTypeId == thrift.STOP { 1790 break 1791 } 1792 1793 switch fieldId { 1794 case 1: 1795 if fieldTypeId == thrift.BOOL { 1796 if err = p.ReadField1(iprot); err != nil { 1797 goto ReadFieldError 1798 } 1799 } else { 1800 if err = iprot.Skip(fieldTypeId); err != nil { 1801 goto SkipFieldError 1802 } 1803 } 1804 case 8: 1805 if fieldTypeId == thrift.LIST { 1806 if err = p.ReadField8(iprot); err != nil { 1807 goto ReadFieldError 1808 } 1809 } else { 1810 if err = iprot.Skip(fieldTypeId); err != nil { 1811 goto SkipFieldError 1812 } 1813 } 1814 case 9: 1815 if fieldTypeId == thrift.MAP { 1816 if err = p.ReadField9(iprot); err != nil { 1817 goto ReadFieldError 1818 } 1819 } else { 1820 if err = iprot.Skip(fieldTypeId); err != nil { 1821 goto SkipFieldError 1822 } 1823 } 1824 case 17: 1825 if fieldTypeId == thrift.MAP { 1826 if err = p.ReadField17(iprot); err != nil { 1827 goto ReadFieldError 1828 } 1829 } else { 1830 if err = iprot.Skip(fieldTypeId); err != nil { 1831 goto SkipFieldError 1832 } 1833 } 1834 case 18: 1835 if fieldTypeId == thrift.LIST { 1836 if err = p.ReadField18(iprot); err != nil { 1837 goto ReadFieldError 1838 } 1839 } else { 1840 if err = iprot.Skip(fieldTypeId); err != nil { 1841 goto SkipFieldError 1842 } 1843 } 1844 case 19: 1845 if fieldTypeId == thrift.MAP { 1846 if err = p.ReadField19(iprot); err != nil { 1847 goto ReadFieldError 1848 } 1849 } else { 1850 if err = iprot.Skip(fieldTypeId); err != nil { 1851 goto SkipFieldError 1852 } 1853 } 1854 case 127: 1855 if fieldTypeId == thrift.MAP { 1856 if err = p.ReadField127(iprot); err != nil { 1857 goto ReadFieldError 1858 } 1859 } else { 1860 if err = iprot.Skip(fieldTypeId); err != nil { 1861 goto SkipFieldError 1862 } 1863 } 1864 default: 1865 if err = iprot.Skip(fieldTypeId); err != nil { 1866 goto SkipFieldError 1867 } 1868 } 1869 1870 if err = iprot.ReadFieldEnd(); err != nil { 1871 goto ReadFieldEndError 1872 } 1873 } 1874 if err = iprot.ReadStructEnd(); err != nil { 1875 goto ReadStructEndError 1876 } 1877 1878 return nil 1879 ReadStructBeginError: 1880 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 1881 ReadFieldBeginError: 1882 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 1883 ReadFieldError: 1884 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_InnerBasePartial[fieldId]), err) 1885 SkipFieldError: 1886 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 1887 1888 ReadFieldEndError: 1889 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 1890 ReadStructEndError: 1891 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 1892 } 1893 1894 func (p *InnerBasePartial) ReadField1(iprot thrift.TProtocol) error { 1895 if v, err := iprot.ReadBool(); err != nil { 1896 return err 1897 } else { 1898 p.Bool = v 1899 } 1900 return nil 1901 } 1902 1903 func (p *InnerBasePartial) ReadField8(iprot thrift.TProtocol) error { 1904 _, size, err := iprot.ReadListBegin() 1905 if err != nil { 1906 return err 1907 } 1908 p.ListInt32 = make([]int32, 0, size) 1909 for i := 0; i < size; i++ { 1910 var _elem int32 1911 if v, err := iprot.ReadI32(); err != nil { 1912 return err 1913 } else { 1914 _elem = v 1915 } 1916 1917 p.ListInt32 = append(p.ListInt32, _elem) 1918 } 1919 if err := iprot.ReadListEnd(); err != nil { 1920 return err 1921 } 1922 return nil 1923 } 1924 1925 func (p *InnerBasePartial) ReadField9(iprot thrift.TProtocol) error { 1926 _, _, size, err := iprot.ReadMapBegin() 1927 if err != nil { 1928 return err 1929 } 1930 p.MapStringString = make(map[string]string, size) 1931 for i := 0; i < size; i++ { 1932 var _key string 1933 if v, err := iprot.ReadString(); err != nil { 1934 return err 1935 } else { 1936 _key = v 1937 } 1938 1939 var _val string 1940 if v, err := iprot.ReadString(); err != nil { 1941 return err 1942 } else { 1943 _val = v 1944 } 1945 1946 p.MapStringString[_key] = _val 1947 } 1948 if err := iprot.ReadMapEnd(); err != nil { 1949 return err 1950 } 1951 return nil 1952 } 1953 1954 func (p *InnerBasePartial) ReadField17(iprot thrift.TProtocol) error { 1955 _, _, size, err := iprot.ReadMapBegin() 1956 if err != nil { 1957 return err 1958 } 1959 p.MapDoubleString = make(map[float64]string, size) 1960 for i := 0; i < size; i++ { 1961 var _key float64 1962 if v, err := iprot.ReadDouble(); err != nil { 1963 return err 1964 } else { 1965 _key = v 1966 } 1967 1968 var _val string 1969 if v, err := iprot.ReadString(); err != nil { 1970 return err 1971 } else { 1972 _val = v 1973 } 1974 1975 p.MapDoubleString[_key] = _val 1976 } 1977 if err := iprot.ReadMapEnd(); err != nil { 1978 return err 1979 } 1980 return nil 1981 } 1982 1983 func (p *InnerBasePartial) ReadField18(iprot thrift.TProtocol) error { 1984 _, size, err := iprot.ReadListBegin() 1985 if err != nil { 1986 return err 1987 } 1988 p.ListInnerBase = make([]*InnerBasePartial, 0, size) 1989 for i := 0; i < size; i++ { 1990 _elem := NewInnerBasePartial() 1991 if err := _elem.Read(iprot); err != nil { 1992 return err 1993 } 1994 1995 p.ListInnerBase = append(p.ListInnerBase, _elem) 1996 } 1997 if err := iprot.ReadListEnd(); err != nil { 1998 return err 1999 } 2000 return nil 2001 } 2002 2003 func (p *InnerBasePartial) ReadField19(iprot thrift.TProtocol) error { 2004 _, _, size, err := iprot.ReadMapBegin() 2005 if err != nil { 2006 return err 2007 } 2008 p.MapInnerBaseInnerBase = make(map[*InnerBasePartial]*InnerBasePartial, size) 2009 for i := 0; i < size; i++ { 2010 _key := NewInnerBasePartial() 2011 if err := _key.Read(iprot); err != nil { 2012 return err 2013 } 2014 _val := NewInnerBasePartial() 2015 if err := _val.Read(iprot); err != nil { 2016 return err 2017 } 2018 2019 p.MapInnerBaseInnerBase[_key] = _val 2020 } 2021 if err := iprot.ReadMapEnd(); err != nil { 2022 return err 2023 } 2024 return nil 2025 } 2026 2027 func (p *InnerBasePartial) ReadField127(iprot thrift.TProtocol) error { 2028 _, _, size, err := iprot.ReadMapBegin() 2029 if err != nil { 2030 return err 2031 } 2032 p.MapStringString2 = make(map[string]string, size) 2033 for i := 0; i < size; i++ { 2034 var _key string 2035 if v, err := iprot.ReadString(); err != nil { 2036 return err 2037 } else { 2038 _key = v 2039 } 2040 2041 var _val string 2042 if v, err := iprot.ReadString(); err != nil { 2043 return err 2044 } else { 2045 _val = v 2046 } 2047 2048 p.MapStringString2[_key] = _val 2049 } 2050 if err := iprot.ReadMapEnd(); err != nil { 2051 return err 2052 } 2053 return nil 2054 } 2055 2056 func (p *InnerBasePartial) Write(oprot thrift.TProtocol) (err error) { 2057 var fieldId int16 2058 if err = oprot.WriteStructBegin("InnerBasePartial"); err != nil { 2059 goto WriteStructBeginError 2060 } 2061 if p != nil { 2062 if err = p.writeField1(oprot); err != nil { 2063 fieldId = 1 2064 goto WriteFieldError 2065 } 2066 if err = p.writeField8(oprot); err != nil { 2067 fieldId = 8 2068 goto WriteFieldError 2069 } 2070 if err = p.writeField9(oprot); err != nil { 2071 fieldId = 9 2072 goto WriteFieldError 2073 } 2074 if err = p.writeField17(oprot); err != nil { 2075 fieldId = 17 2076 goto WriteFieldError 2077 } 2078 if err = p.writeField18(oprot); err != nil { 2079 fieldId = 18 2080 goto WriteFieldError 2081 } 2082 if err = p.writeField19(oprot); err != nil { 2083 fieldId = 19 2084 goto WriteFieldError 2085 } 2086 if err = p.writeField127(oprot); err != nil { 2087 fieldId = 127 2088 goto WriteFieldError 2089 } 2090 2091 } 2092 if err = oprot.WriteFieldStop(); err != nil { 2093 goto WriteFieldStopError 2094 } 2095 if err = oprot.WriteStructEnd(); err != nil { 2096 goto WriteStructEndError 2097 } 2098 return nil 2099 WriteStructBeginError: 2100 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 2101 WriteFieldError: 2102 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 2103 WriteFieldStopError: 2104 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 2105 WriteStructEndError: 2106 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 2107 } 2108 2109 func (p *InnerBasePartial) writeField1(oprot thrift.TProtocol) (err error) { 2110 if err = oprot.WriteFieldBegin("Bool", thrift.BOOL, 1); err != nil { 2111 goto WriteFieldBeginError 2112 } 2113 if err := oprot.WriteBool(p.Bool); err != nil { 2114 return err 2115 } 2116 if err = oprot.WriteFieldEnd(); err != nil { 2117 goto WriteFieldEndError 2118 } 2119 return nil 2120 WriteFieldBeginError: 2121 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 2122 WriteFieldEndError: 2123 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 2124 } 2125 2126 func (p *InnerBasePartial) writeField8(oprot thrift.TProtocol) (err error) { 2127 if err = oprot.WriteFieldBegin("ListInt32", thrift.LIST, 8); err != nil { 2128 goto WriteFieldBeginError 2129 } 2130 if err := oprot.WriteListBegin(thrift.I32, len(p.ListInt32)); err != nil { 2131 return err 2132 } 2133 for _, v := range p.ListInt32 { 2134 if err := oprot.WriteI32(v); err != nil { 2135 return err 2136 } 2137 } 2138 if err := oprot.WriteListEnd(); err != nil { 2139 return err 2140 } 2141 if err = oprot.WriteFieldEnd(); err != nil { 2142 goto WriteFieldEndError 2143 } 2144 return nil 2145 WriteFieldBeginError: 2146 return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) 2147 WriteFieldEndError: 2148 return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) 2149 } 2150 2151 func (p *InnerBasePartial) writeField9(oprot thrift.TProtocol) (err error) { 2152 if err = oprot.WriteFieldBegin("MapStringString", thrift.MAP, 9); err != nil { 2153 goto WriteFieldBeginError 2154 } 2155 if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.MapStringString)); err != nil { 2156 return err 2157 } 2158 for k, v := range p.MapStringString { 2159 2160 if err := oprot.WriteString(k); err != nil { 2161 return err 2162 } 2163 2164 if err := oprot.WriteString(v); err != nil { 2165 return err 2166 } 2167 } 2168 if err := oprot.WriteMapEnd(); err != nil { 2169 return err 2170 } 2171 if err = oprot.WriteFieldEnd(); err != nil { 2172 goto WriteFieldEndError 2173 } 2174 return nil 2175 WriteFieldBeginError: 2176 return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) 2177 WriteFieldEndError: 2178 return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) 2179 } 2180 2181 func (p *InnerBasePartial) writeField17(oprot thrift.TProtocol) (err error) { 2182 if err = oprot.WriteFieldBegin("MapDoubleString", thrift.MAP, 17); err != nil { 2183 goto WriteFieldBeginError 2184 } 2185 if err := oprot.WriteMapBegin(thrift.DOUBLE, thrift.STRING, len(p.MapDoubleString)); err != nil { 2186 return err 2187 } 2188 for k, v := range p.MapDoubleString { 2189 2190 if err := oprot.WriteDouble(k); err != nil { 2191 return err 2192 } 2193 2194 if err := oprot.WriteString(v); err != nil { 2195 return err 2196 } 2197 } 2198 if err := oprot.WriteMapEnd(); err != nil { 2199 return err 2200 } 2201 if err = oprot.WriteFieldEnd(); err != nil { 2202 goto WriteFieldEndError 2203 } 2204 return nil 2205 WriteFieldBeginError: 2206 return thrift.PrependError(fmt.Sprintf("%T write field 17 begin error: ", p), err) 2207 WriteFieldEndError: 2208 return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err) 2209 } 2210 2211 func (p *InnerBasePartial) writeField18(oprot thrift.TProtocol) (err error) { 2212 if err = oprot.WriteFieldBegin("ListInnerBase", thrift.LIST, 18); err != nil { 2213 goto WriteFieldBeginError 2214 } 2215 if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ListInnerBase)); err != nil { 2216 return err 2217 } 2218 for _, v := range p.ListInnerBase { 2219 if err := v.Write(oprot); err != nil { 2220 return err 2221 } 2222 } 2223 if err := oprot.WriteListEnd(); err != nil { 2224 return err 2225 } 2226 if err = oprot.WriteFieldEnd(); err != nil { 2227 goto WriteFieldEndError 2228 } 2229 return nil 2230 WriteFieldBeginError: 2231 return thrift.PrependError(fmt.Sprintf("%T write field 18 begin error: ", p), err) 2232 WriteFieldEndError: 2233 return thrift.PrependError(fmt.Sprintf("%T write field 18 end error: ", p), err) 2234 } 2235 2236 func (p *InnerBasePartial) writeField19(oprot thrift.TProtocol) (err error) { 2237 if err = oprot.WriteFieldBegin("MapInnerBaseInnerBase", thrift.MAP, 19); err != nil { 2238 goto WriteFieldBeginError 2239 } 2240 if err := oprot.WriteMapBegin(thrift.STRUCT, thrift.STRUCT, len(p.MapInnerBaseInnerBase)); err != nil { 2241 return err 2242 } 2243 for k, v := range p.MapInnerBaseInnerBase { 2244 2245 if err := k.Write(oprot); err != nil { 2246 return err 2247 } 2248 2249 if err := v.Write(oprot); err != nil { 2250 return err 2251 } 2252 } 2253 if err := oprot.WriteMapEnd(); err != nil { 2254 return err 2255 } 2256 if err = oprot.WriteFieldEnd(); err != nil { 2257 goto WriteFieldEndError 2258 } 2259 return nil 2260 WriteFieldBeginError: 2261 return thrift.PrependError(fmt.Sprintf("%T write field 19 begin error: ", p), err) 2262 WriteFieldEndError: 2263 return thrift.PrependError(fmt.Sprintf("%T write field 19 end error: ", p), err) 2264 } 2265 2266 func (p *InnerBasePartial) writeField127(oprot thrift.TProtocol) (err error) { 2267 if err = oprot.WriteFieldBegin("MapStringString2", thrift.MAP, 127); err != nil { 2268 goto WriteFieldBeginError 2269 } 2270 if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.MapStringString2)); err != nil { 2271 return err 2272 } 2273 for k, v := range p.MapStringString2 { 2274 2275 if err := oprot.WriteString(k); err != nil { 2276 return err 2277 } 2278 2279 if err := oprot.WriteString(v); err != nil { 2280 return err 2281 } 2282 } 2283 if err := oprot.WriteMapEnd(); err != nil { 2284 return err 2285 } 2286 if err = oprot.WriteFieldEnd(); err != nil { 2287 goto WriteFieldEndError 2288 } 2289 return nil 2290 WriteFieldBeginError: 2291 return thrift.PrependError(fmt.Sprintf("%T write field 127 begin error: ", p), err) 2292 WriteFieldEndError: 2293 return thrift.PrependError(fmt.Sprintf("%T write field 127 end error: ", p), err) 2294 } 2295 2296 func (p *InnerBasePartial) String() string { 2297 if p == nil { 2298 return "<nil>" 2299 } 2300 return fmt.Sprintf("InnerBasePartial(%+v)", *p) 2301 } 2302 2303 func (p *InnerBasePartial) DeepEqual(ano *InnerBasePartial) bool { 2304 if p == ano { 2305 return true 2306 } else if p == nil || ano == nil { 2307 return false 2308 } 2309 if !p.Field1DeepEqual(ano.Bool) { 2310 return false 2311 } 2312 if !p.Field8DeepEqual(ano.ListInt32) { 2313 return false 2314 } 2315 if !p.Field9DeepEqual(ano.MapStringString) { 2316 return false 2317 } 2318 if !p.Field17DeepEqual(ano.MapDoubleString) { 2319 return false 2320 } 2321 if !p.Field18DeepEqual(ano.ListInnerBase) { 2322 return false 2323 } 2324 if !p.Field19DeepEqual(ano.MapInnerBaseInnerBase) { 2325 return false 2326 } 2327 if !p.Field127DeepEqual(ano.MapStringString2) { 2328 return false 2329 } 2330 return true 2331 } 2332 2333 func (p *InnerBasePartial) Field1DeepEqual(src bool) bool { 2334 2335 if p.Bool != src { 2336 return false 2337 } 2338 return true 2339 } 2340 func (p *InnerBasePartial) Field8DeepEqual(src []int32) bool { 2341 2342 if len(p.ListInt32) != len(src) { 2343 return false 2344 } 2345 for i, v := range p.ListInt32 { 2346 _src := src[i] 2347 if v != _src { 2348 return false 2349 } 2350 } 2351 return true 2352 } 2353 func (p *InnerBasePartial) Field9DeepEqual(src map[string]string) bool { 2354 2355 if len(p.MapStringString) != len(src) { 2356 return false 2357 } 2358 for k, v := range p.MapStringString { 2359 _src := src[k] 2360 if strings.Compare(v, _src) != 0 { 2361 return false 2362 } 2363 } 2364 return true 2365 } 2366 func (p *InnerBasePartial) Field17DeepEqual(src map[float64]string) bool { 2367 2368 if len(p.MapDoubleString) != len(src) { 2369 return false 2370 } 2371 for k, v := range p.MapDoubleString { 2372 _src := src[k] 2373 if strings.Compare(v, _src) != 0 { 2374 return false 2375 } 2376 } 2377 return true 2378 } 2379 func (p *InnerBasePartial) Field18DeepEqual(src []*InnerBasePartial) bool { 2380 2381 if len(p.ListInnerBase) != len(src) { 2382 return false 2383 } 2384 for i, v := range p.ListInnerBase { 2385 _src := src[i] 2386 if !v.DeepEqual(_src) { 2387 return false 2388 } 2389 } 2390 return true 2391 } 2392 func (p *InnerBasePartial) Field19DeepEqual(src map[*InnerBasePartial]*InnerBasePartial) bool { 2393 2394 if len(p.MapInnerBaseInnerBase) != len(src) { 2395 return false 2396 } 2397 for k, v := range p.MapInnerBaseInnerBase { 2398 _src := src[k] 2399 if !v.DeepEqual(_src) { 2400 return false 2401 } 2402 } 2403 return true 2404 } 2405 func (p *InnerBasePartial) Field127DeepEqual(src map[string]string) bool { 2406 2407 if len(p.MapStringString2) != len(src) { 2408 return false 2409 } 2410 for k, v := range p.MapStringString2 { 2411 _src := src[k] 2412 if strings.Compare(v, _src) != 0 { 2413 return false 2414 } 2415 } 2416 return true 2417 } 2418 2419 type BasePartial struct { 2420 TrafficEnv *base.TrafficEnv `thrift:"TrafficEnv,5" json:"TrafficEnv,omitempty"` 2421 } 2422 2423 func NewBasePartial() *BasePartial { 2424 return &BasePartial{} 2425 } 2426 2427 var BasePartial_TrafficEnv_DEFAULT *base.TrafficEnv 2428 2429 func (p *BasePartial) GetTrafficEnv() (v *base.TrafficEnv) { 2430 if !p.IsSetTrafficEnv() { 2431 return BasePartial_TrafficEnv_DEFAULT 2432 } 2433 return p.TrafficEnv 2434 } 2435 func (p *BasePartial) SetTrafficEnv(val *base.TrafficEnv) { 2436 p.TrafficEnv = val 2437 } 2438 2439 var fieldIDToName_BasePartial = map[int16]string{ 2440 5: "TrafficEnv", 2441 } 2442 2443 func (p *BasePartial) IsSetTrafficEnv() bool { 2444 return p.TrafficEnv != nil 2445 } 2446 2447 func (p *BasePartial) Read(iprot thrift.TProtocol) (err error) { 2448 2449 var fieldTypeId thrift.TType 2450 var fieldId int16 2451 2452 if _, err = iprot.ReadStructBegin(); err != nil { 2453 goto ReadStructBeginError 2454 } 2455 2456 for { 2457 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 2458 if err != nil { 2459 goto ReadFieldBeginError 2460 } 2461 if fieldTypeId == thrift.STOP { 2462 break 2463 } 2464 2465 switch fieldId { 2466 case 5: 2467 if fieldTypeId == thrift.STRUCT { 2468 if err = p.ReadField5(iprot); err != nil { 2469 goto ReadFieldError 2470 } 2471 } else { 2472 if err = iprot.Skip(fieldTypeId); err != nil { 2473 goto SkipFieldError 2474 } 2475 } 2476 default: 2477 if err = iprot.Skip(fieldTypeId); err != nil { 2478 goto SkipFieldError 2479 } 2480 } 2481 2482 if err = iprot.ReadFieldEnd(); err != nil { 2483 goto ReadFieldEndError 2484 } 2485 } 2486 if err = iprot.ReadStructEnd(); err != nil { 2487 goto ReadStructEndError 2488 } 2489 2490 return nil 2491 ReadStructBeginError: 2492 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 2493 ReadFieldBeginError: 2494 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 2495 ReadFieldError: 2496 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BasePartial[fieldId]), err) 2497 SkipFieldError: 2498 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 2499 2500 ReadFieldEndError: 2501 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 2502 ReadStructEndError: 2503 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 2504 } 2505 2506 func (p *BasePartial) ReadField5(iprot thrift.TProtocol) error { 2507 p.TrafficEnv = base.NewTrafficEnv() 2508 if err := p.TrafficEnv.Read(iprot); err != nil { 2509 return err 2510 } 2511 return nil 2512 } 2513 2514 func (p *BasePartial) Write(oprot thrift.TProtocol) (err error) { 2515 var fieldId int16 2516 if err = oprot.WriteStructBegin("BasePartial"); err != nil { 2517 goto WriteStructBeginError 2518 } 2519 if p != nil { 2520 if err = p.writeField5(oprot); err != nil { 2521 fieldId = 5 2522 goto WriteFieldError 2523 } 2524 2525 } 2526 if err = oprot.WriteFieldStop(); err != nil { 2527 goto WriteFieldStopError 2528 } 2529 if err = oprot.WriteStructEnd(); err != nil { 2530 goto WriteStructEndError 2531 } 2532 return nil 2533 WriteStructBeginError: 2534 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 2535 WriteFieldError: 2536 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 2537 WriteFieldStopError: 2538 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 2539 WriteStructEndError: 2540 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 2541 } 2542 2543 func (p *BasePartial) writeField5(oprot thrift.TProtocol) (err error) { 2544 if p.IsSetTrafficEnv() { 2545 if err = oprot.WriteFieldBegin("TrafficEnv", thrift.STRUCT, 5); err != nil { 2546 goto WriteFieldBeginError 2547 } 2548 if err := p.TrafficEnv.Write(oprot); err != nil { 2549 return err 2550 } 2551 if err = oprot.WriteFieldEnd(); err != nil { 2552 goto WriteFieldEndError 2553 } 2554 } 2555 return nil 2556 WriteFieldBeginError: 2557 return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) 2558 WriteFieldEndError: 2559 return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) 2560 } 2561 2562 func (p *BasePartial) String() string { 2563 if p == nil { 2564 return "<nil>" 2565 } 2566 return fmt.Sprintf("BasePartial(%+v)", *p) 2567 } 2568 2569 func (p *BasePartial) DeepEqual(ano *BasePartial) bool { 2570 if p == ano { 2571 return true 2572 } else if p == nil || ano == nil { 2573 return false 2574 } 2575 if !p.Field5DeepEqual(ano.TrafficEnv) { 2576 return false 2577 } 2578 return true 2579 } 2580 2581 func (p *BasePartial) Field5DeepEqual(src *base.TrafficEnv) bool { 2582 2583 if !p.TrafficEnv.DeepEqual(src) { 2584 return false 2585 } 2586 return true 2587 } 2588 2589 type ExampleReq struct { 2590 Msg *string `thrift:"Msg,1" json:"Msg,omitempty"` 2591 A *int32 `thrift:"A,2" json:"A,omitempty"` 2592 InnerBase *InnerBase `thrift:"InnerBase,3" json:"InnerBase"` 2593 Base *base.Base `thrift:"Base,255,required" json:"Base"` 2594 Subfix float64 `thrift:"Subfix,32767" json:"Subfix"` 2595 } 2596 2597 func NewExampleReq() *ExampleReq { 2598 return &ExampleReq{} 2599 } 2600 2601 var ExampleReq_Msg_DEFAULT string 2602 2603 func (p *ExampleReq) GetMsg() (v string) { 2604 if !p.IsSetMsg() { 2605 return ExampleReq_Msg_DEFAULT 2606 } 2607 return *p.Msg 2608 } 2609 2610 var ExampleReq_A_DEFAULT int32 2611 2612 func (p *ExampleReq) GetA() (v int32) { 2613 if !p.IsSetA() { 2614 return ExampleReq_A_DEFAULT 2615 } 2616 return *p.A 2617 } 2618 2619 var ExampleReq_InnerBase_DEFAULT *InnerBase 2620 2621 func (p *ExampleReq) GetInnerBase() (v *InnerBase) { 2622 if !p.IsSetInnerBase() { 2623 return ExampleReq_InnerBase_DEFAULT 2624 } 2625 return p.InnerBase 2626 } 2627 2628 var ExampleReq_Base_DEFAULT *base.Base 2629 2630 func (p *ExampleReq) GetBase() (v *base.Base) { 2631 if !p.IsSetBase() { 2632 return ExampleReq_Base_DEFAULT 2633 } 2634 return p.Base 2635 } 2636 2637 func (p *ExampleReq) GetSubfix() (v float64) { 2638 return p.Subfix 2639 } 2640 func (p *ExampleReq) SetMsg(val *string) { 2641 p.Msg = val 2642 } 2643 func (p *ExampleReq) SetA(val *int32) { 2644 p.A = val 2645 } 2646 func (p *ExampleReq) SetInnerBase(val *InnerBase) { 2647 p.InnerBase = val 2648 } 2649 func (p *ExampleReq) SetBase(val *base.Base) { 2650 p.Base = val 2651 } 2652 func (p *ExampleReq) SetSubfix(val float64) { 2653 p.Subfix = val 2654 } 2655 2656 var fieldIDToName_ExampleReq = map[int16]string{ 2657 1: "Msg", 2658 2: "A", 2659 3: "InnerBase", 2660 255: "Base", 2661 32767: "Subfix", 2662 } 2663 2664 func (p *ExampleReq) IsSetMsg() bool { 2665 return p.Msg != nil 2666 } 2667 2668 func (p *ExampleReq) IsSetA() bool { 2669 return p.A != nil 2670 } 2671 2672 func (p *ExampleReq) IsSetInnerBase() bool { 2673 return p.InnerBase != nil 2674 } 2675 2676 func (p *ExampleReq) IsSetBase() bool { 2677 return p.Base != nil 2678 } 2679 2680 func (p *ExampleReq) Read(iprot thrift.TProtocol) (err error) { 2681 2682 var fieldTypeId thrift.TType 2683 var fieldId int16 2684 var issetBase bool = false 2685 2686 if _, err = iprot.ReadStructBegin(); err != nil { 2687 goto ReadStructBeginError 2688 } 2689 2690 for { 2691 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 2692 if err != nil { 2693 goto ReadFieldBeginError 2694 } 2695 if fieldTypeId == thrift.STOP { 2696 break 2697 } 2698 2699 switch fieldId { 2700 case 1: 2701 if fieldTypeId == thrift.STRING { 2702 if err = p.ReadField1(iprot); err != nil { 2703 goto ReadFieldError 2704 } 2705 } else { 2706 if err = iprot.Skip(fieldTypeId); err != nil { 2707 goto SkipFieldError 2708 } 2709 } 2710 case 2: 2711 if fieldTypeId == thrift.I32 { 2712 if err = p.ReadField2(iprot); err != nil { 2713 goto ReadFieldError 2714 } 2715 } else { 2716 if err = iprot.Skip(fieldTypeId); err != nil { 2717 goto SkipFieldError 2718 } 2719 } 2720 case 3: 2721 if fieldTypeId == thrift.STRUCT { 2722 if err = p.ReadField3(iprot); err != nil { 2723 goto ReadFieldError 2724 } 2725 } else { 2726 if err = iprot.Skip(fieldTypeId); err != nil { 2727 goto SkipFieldError 2728 } 2729 } 2730 case 255: 2731 if fieldTypeId == thrift.STRUCT { 2732 if err = p.ReadField255(iprot); err != nil { 2733 goto ReadFieldError 2734 } 2735 issetBase = true 2736 } else { 2737 if err = iprot.Skip(fieldTypeId); err != nil { 2738 goto SkipFieldError 2739 } 2740 } 2741 case 32767: 2742 if fieldTypeId == thrift.DOUBLE { 2743 if err = p.ReadField32767(iprot); err != nil { 2744 goto ReadFieldError 2745 } 2746 } else { 2747 if err = iprot.Skip(fieldTypeId); err != nil { 2748 goto SkipFieldError 2749 } 2750 } 2751 default: 2752 if err = iprot.Skip(fieldTypeId); err != nil { 2753 goto SkipFieldError 2754 } 2755 } 2756 2757 if err = iprot.ReadFieldEnd(); err != nil { 2758 goto ReadFieldEndError 2759 } 2760 } 2761 if err = iprot.ReadStructEnd(); err != nil { 2762 goto ReadStructEndError 2763 } 2764 2765 if !issetBase { 2766 fieldId = 255 2767 goto RequiredFieldNotSetError 2768 } 2769 return nil 2770 ReadStructBeginError: 2771 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 2772 ReadFieldBeginError: 2773 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 2774 ReadFieldError: 2775 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleReq[fieldId]), err) 2776 SkipFieldError: 2777 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 2778 2779 ReadFieldEndError: 2780 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 2781 ReadStructEndError: 2782 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 2783 RequiredFieldNotSetError: 2784 return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field %s is not set", fieldIDToName_ExampleReq[fieldId])) 2785 } 2786 2787 func (p *ExampleReq) ReadField1(iprot thrift.TProtocol) error { 2788 if v, err := iprot.ReadString(); err != nil { 2789 return err 2790 } else { 2791 p.Msg = &v 2792 } 2793 return nil 2794 } 2795 2796 func (p *ExampleReq) ReadField2(iprot thrift.TProtocol) error { 2797 if v, err := iprot.ReadI32(); err != nil { 2798 return err 2799 } else { 2800 p.A = &v 2801 } 2802 return nil 2803 } 2804 2805 func (p *ExampleReq) ReadField3(iprot thrift.TProtocol) error { 2806 p.InnerBase = NewInnerBase() 2807 if err := p.InnerBase.Read(iprot); err != nil { 2808 return err 2809 } 2810 return nil 2811 } 2812 2813 func (p *ExampleReq) ReadField255(iprot thrift.TProtocol) error { 2814 p.Base = base.NewBase() 2815 if err := p.Base.Read(iprot); err != nil { 2816 return err 2817 } 2818 return nil 2819 } 2820 2821 func (p *ExampleReq) ReadField32767(iprot thrift.TProtocol) error { 2822 if v, err := iprot.ReadDouble(); err != nil { 2823 return err 2824 } else { 2825 p.Subfix = v 2826 } 2827 return nil 2828 } 2829 2830 func (p *ExampleReq) Write(oprot thrift.TProtocol) (err error) { 2831 var fieldId int16 2832 if err = oprot.WriteStructBegin("ExampleReq"); err != nil { 2833 goto WriteStructBeginError 2834 } 2835 if p != nil { 2836 if err = p.writeField1(oprot); err != nil { 2837 fieldId = 1 2838 goto WriteFieldError 2839 } 2840 if err = p.writeField2(oprot); err != nil { 2841 fieldId = 2 2842 goto WriteFieldError 2843 } 2844 if err = p.writeField3(oprot); err != nil { 2845 fieldId = 3 2846 goto WriteFieldError 2847 } 2848 if err = p.writeField255(oprot); err != nil { 2849 fieldId = 255 2850 goto WriteFieldError 2851 } 2852 if err = p.writeField32767(oprot); err != nil { 2853 fieldId = 32767 2854 goto WriteFieldError 2855 } 2856 2857 } 2858 if err = oprot.WriteFieldStop(); err != nil { 2859 goto WriteFieldStopError 2860 } 2861 if err = oprot.WriteStructEnd(); err != nil { 2862 goto WriteStructEndError 2863 } 2864 return nil 2865 WriteStructBeginError: 2866 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 2867 WriteFieldError: 2868 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 2869 WriteFieldStopError: 2870 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 2871 WriteStructEndError: 2872 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 2873 } 2874 2875 func (p *ExampleReq) writeField1(oprot thrift.TProtocol) (err error) { 2876 if p.IsSetMsg() { 2877 if err = oprot.WriteFieldBegin("Msg", thrift.STRING, 1); err != nil { 2878 goto WriteFieldBeginError 2879 } 2880 if err := oprot.WriteString(*p.Msg); err != nil { 2881 return err 2882 } 2883 if err = oprot.WriteFieldEnd(); err != nil { 2884 goto WriteFieldEndError 2885 } 2886 } 2887 return nil 2888 WriteFieldBeginError: 2889 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 2890 WriteFieldEndError: 2891 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 2892 } 2893 2894 func (p *ExampleReq) writeField2(oprot thrift.TProtocol) (err error) { 2895 if p.IsSetA() { 2896 if err = oprot.WriteFieldBegin("A", thrift.I32, 2); err != nil { 2897 goto WriteFieldBeginError 2898 } 2899 if err := oprot.WriteI32(*p.A); err != nil { 2900 return err 2901 } 2902 if err = oprot.WriteFieldEnd(); err != nil { 2903 goto WriteFieldEndError 2904 } 2905 } 2906 return nil 2907 WriteFieldBeginError: 2908 return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) 2909 WriteFieldEndError: 2910 return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) 2911 } 2912 2913 func (p *ExampleReq) writeField3(oprot thrift.TProtocol) (err error) { 2914 if err = oprot.WriteFieldBegin("InnerBase", thrift.STRUCT, 3); err != nil { 2915 goto WriteFieldBeginError 2916 } 2917 if err := p.InnerBase.Write(oprot); err != nil { 2918 return err 2919 } 2920 if err = oprot.WriteFieldEnd(); err != nil { 2921 goto WriteFieldEndError 2922 } 2923 return nil 2924 WriteFieldBeginError: 2925 return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) 2926 WriteFieldEndError: 2927 return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) 2928 } 2929 2930 func (p *ExampleReq) writeField255(oprot thrift.TProtocol) (err error) { 2931 if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { 2932 goto WriteFieldBeginError 2933 } 2934 if err := p.Base.Write(oprot); err != nil { 2935 return err 2936 } 2937 if err = oprot.WriteFieldEnd(); err != nil { 2938 goto WriteFieldEndError 2939 } 2940 return nil 2941 WriteFieldBeginError: 2942 return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) 2943 WriteFieldEndError: 2944 return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) 2945 } 2946 2947 func (p *ExampleReq) writeField32767(oprot thrift.TProtocol) (err error) { 2948 if err = oprot.WriteFieldBegin("Subfix", thrift.DOUBLE, 32767); err != nil { 2949 goto WriteFieldBeginError 2950 } 2951 if err := oprot.WriteDouble(p.Subfix); err != nil { 2952 return err 2953 } 2954 if err = oprot.WriteFieldEnd(); err != nil { 2955 goto WriteFieldEndError 2956 } 2957 return nil 2958 WriteFieldBeginError: 2959 return thrift.PrependError(fmt.Sprintf("%T write field 32767 begin error: ", p), err) 2960 WriteFieldEndError: 2961 return thrift.PrependError(fmt.Sprintf("%T write field 32767 end error: ", p), err) 2962 } 2963 2964 func (p *ExampleReq) String() string { 2965 if p == nil { 2966 return "<nil>" 2967 } 2968 return fmt.Sprintf("ExampleReq(%+v)", *p) 2969 } 2970 2971 func (p *ExampleReq) DeepEqual(ano *ExampleReq) bool { 2972 if p == ano { 2973 return true 2974 } else if p == nil || ano == nil { 2975 return false 2976 } 2977 if !p.Field1DeepEqual(ano.Msg) { 2978 return false 2979 } 2980 if !p.Field2DeepEqual(ano.A) { 2981 return false 2982 } 2983 if !p.Field3DeepEqual(ano.InnerBase) { 2984 return false 2985 } 2986 if !p.Field255DeepEqual(ano.Base) { 2987 return false 2988 } 2989 if !p.Field32767DeepEqual(ano.Subfix) { 2990 return false 2991 } 2992 return true 2993 } 2994 2995 func (p *ExampleReq) Field1DeepEqual(src *string) bool { 2996 2997 if p.Msg == src { 2998 return true 2999 } else if p.Msg == nil || src == nil { 3000 return false 3001 } 3002 if strings.Compare(*p.Msg, *src) != 0 { 3003 return false 3004 } 3005 return true 3006 } 3007 func (p *ExampleReq) Field2DeepEqual(src *int32) bool { 3008 3009 if p.A == src { 3010 return true 3011 } else if p.A == nil || src == nil { 3012 return false 3013 } 3014 if *p.A != *src { 3015 return false 3016 } 3017 return true 3018 } 3019 func (p *ExampleReq) Field3DeepEqual(src *InnerBase) bool { 3020 3021 if !p.InnerBase.DeepEqual(src) { 3022 return false 3023 } 3024 return true 3025 } 3026 func (p *ExampleReq) Field255DeepEqual(src *base.Base) bool { 3027 3028 if !p.Base.DeepEqual(src) { 3029 return false 3030 } 3031 return true 3032 } 3033 func (p *ExampleReq) Field32767DeepEqual(src float64) bool { 3034 3035 if p.Subfix != src { 3036 return false 3037 } 3038 return true 3039 } 3040 3041 type ExampleSuper struct { 3042 Msg *string `thrift:"Msg,1" json:"Msg,omitempty"` 3043 A *int32 `thrift:"A,2" json:"A,omitempty"` 3044 InnerBase *InnerBase `thrift:"InnerBase,3" json:"InnerBase"` 3045 Ex1 string `thrift:"Ex1,4" json:"Ex1"` 3046 Ex2 *string `thrift:"Ex2,5" json:"Ex2,omitempty"` 3047 Ex3 *string `thrift:"Ex3,6" json:"Ex3,omitempty"` 3048 Ex4 string `thrift:"Ex4,7,required" json:"Ex4"` 3049 SelfRef *SelfRef `thrift:"SelfRef,9" json:"SelfRef"` 3050 Base *base.Base `thrift:"Base,255,required" json:"Base"` 3051 Subfix float64 `thrift:"Subfix,32767" json:"Subfix"` 3052 } 3053 3054 func NewExampleSuper() *ExampleSuper { 3055 return &ExampleSuper{} 3056 } 3057 3058 var ExampleSuper_Msg_DEFAULT string 3059 3060 func (p *ExampleSuper) GetMsg() (v string) { 3061 if !p.IsSetMsg() { 3062 return ExampleSuper_Msg_DEFAULT 3063 } 3064 return *p.Msg 3065 } 3066 3067 var ExampleSuper_A_DEFAULT int32 3068 3069 func (p *ExampleSuper) GetA() (v int32) { 3070 if !p.IsSetA() { 3071 return ExampleSuper_A_DEFAULT 3072 } 3073 return *p.A 3074 } 3075 3076 var ExampleSuper_InnerBase_DEFAULT *InnerBase 3077 3078 func (p *ExampleSuper) GetInnerBase() (v *InnerBase) { 3079 if !p.IsSetInnerBase() { 3080 return ExampleSuper_InnerBase_DEFAULT 3081 } 3082 return p.InnerBase 3083 } 3084 3085 func (p *ExampleSuper) GetEx1() (v string) { 3086 return p.Ex1 3087 } 3088 3089 var ExampleSuper_Ex2_DEFAULT string 3090 3091 func (p *ExampleSuper) GetEx2() (v string) { 3092 if !p.IsSetEx2() { 3093 return ExampleSuper_Ex2_DEFAULT 3094 } 3095 return *p.Ex2 3096 } 3097 3098 var ExampleSuper_Ex3_DEFAULT string 3099 3100 func (p *ExampleSuper) GetEx3() (v string) { 3101 if !p.IsSetEx3() { 3102 return ExampleSuper_Ex3_DEFAULT 3103 } 3104 return *p.Ex3 3105 } 3106 3107 func (p *ExampleSuper) GetEx4() (v string) { 3108 return p.Ex4 3109 } 3110 3111 var ExampleSuper_SelfRef_DEFAULT *SelfRef 3112 3113 func (p *ExampleSuper) GetSelfRef() (v *SelfRef) { 3114 if !p.IsSetSelfRef() { 3115 return ExampleSuper_SelfRef_DEFAULT 3116 } 3117 return p.SelfRef 3118 } 3119 3120 var ExampleSuper_Base_DEFAULT *base.Base 3121 3122 func (p *ExampleSuper) GetBase() (v *base.Base) { 3123 if !p.IsSetBase() { 3124 return ExampleSuper_Base_DEFAULT 3125 } 3126 return p.Base 3127 } 3128 3129 func (p *ExampleSuper) GetSubfix() (v float64) { 3130 return p.Subfix 3131 } 3132 func (p *ExampleSuper) SetMsg(val *string) { 3133 p.Msg = val 3134 } 3135 func (p *ExampleSuper) SetA(val *int32) { 3136 p.A = val 3137 } 3138 func (p *ExampleSuper) SetInnerBase(val *InnerBase) { 3139 p.InnerBase = val 3140 } 3141 func (p *ExampleSuper) SetEx1(val string) { 3142 p.Ex1 = val 3143 } 3144 func (p *ExampleSuper) SetEx2(val *string) { 3145 p.Ex2 = val 3146 } 3147 func (p *ExampleSuper) SetEx3(val *string) { 3148 p.Ex3 = val 3149 } 3150 func (p *ExampleSuper) SetEx4(val string) { 3151 p.Ex4 = val 3152 } 3153 func (p *ExampleSuper) SetSelfRef(val *SelfRef) { 3154 p.SelfRef = val 3155 } 3156 func (p *ExampleSuper) SetBase(val *base.Base) { 3157 p.Base = val 3158 } 3159 func (p *ExampleSuper) SetSubfix(val float64) { 3160 p.Subfix = val 3161 } 3162 3163 var fieldIDToName_ExampleSuper = map[int16]string{ 3164 1: "Msg", 3165 2: "A", 3166 3: "InnerBase", 3167 4: "Ex1", 3168 5: "Ex2", 3169 6: "Ex3", 3170 7: "Ex4", 3171 9: "SelfRef", 3172 255: "Base", 3173 32767: "Subfix", 3174 } 3175 3176 func (p *ExampleSuper) IsSetMsg() bool { 3177 return p.Msg != nil 3178 } 3179 3180 func (p *ExampleSuper) IsSetA() bool { 3181 return p.A != nil 3182 } 3183 3184 func (p *ExampleSuper) IsSetInnerBase() bool { 3185 return p.InnerBase != nil 3186 } 3187 3188 func (p *ExampleSuper) IsSetEx2() bool { 3189 return p.Ex2 != nil 3190 } 3191 3192 func (p *ExampleSuper) IsSetEx3() bool { 3193 return p.Ex3 != nil 3194 } 3195 3196 func (p *ExampleSuper) IsSetSelfRef() bool { 3197 return p.SelfRef != nil 3198 } 3199 3200 func (p *ExampleSuper) IsSetBase() bool { 3201 return p.Base != nil 3202 } 3203 3204 func (p *ExampleSuper) Read(iprot thrift.TProtocol) (err error) { 3205 3206 var fieldTypeId thrift.TType 3207 var fieldId int16 3208 var issetEx4 bool = false 3209 var issetBase bool = false 3210 3211 if _, err = iprot.ReadStructBegin(); err != nil { 3212 goto ReadStructBeginError 3213 } 3214 3215 for { 3216 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 3217 if err != nil { 3218 goto ReadFieldBeginError 3219 } 3220 if fieldTypeId == thrift.STOP { 3221 break 3222 } 3223 3224 switch fieldId { 3225 case 1: 3226 if fieldTypeId == thrift.STRING { 3227 if err = p.ReadField1(iprot); err != nil { 3228 goto ReadFieldError 3229 } 3230 } else { 3231 if err = iprot.Skip(fieldTypeId); err != nil { 3232 goto SkipFieldError 3233 } 3234 } 3235 case 2: 3236 if fieldTypeId == thrift.I32 { 3237 if err = p.ReadField2(iprot); err != nil { 3238 goto ReadFieldError 3239 } 3240 } else { 3241 if err = iprot.Skip(fieldTypeId); err != nil { 3242 goto SkipFieldError 3243 } 3244 } 3245 case 3: 3246 if fieldTypeId == thrift.STRUCT { 3247 if err = p.ReadField3(iprot); err != nil { 3248 goto ReadFieldError 3249 } 3250 } else { 3251 if err = iprot.Skip(fieldTypeId); err != nil { 3252 goto SkipFieldError 3253 } 3254 } 3255 case 4: 3256 if fieldTypeId == thrift.STRING { 3257 if err = p.ReadField4(iprot); err != nil { 3258 goto ReadFieldError 3259 } 3260 } else { 3261 if err = iprot.Skip(fieldTypeId); err != nil { 3262 goto SkipFieldError 3263 } 3264 } 3265 case 5: 3266 if fieldTypeId == thrift.STRING { 3267 if err = p.ReadField5(iprot); err != nil { 3268 goto ReadFieldError 3269 } 3270 } else { 3271 if err = iprot.Skip(fieldTypeId); err != nil { 3272 goto SkipFieldError 3273 } 3274 } 3275 case 6: 3276 if fieldTypeId == thrift.STRING { 3277 if err = p.ReadField6(iprot); err != nil { 3278 goto ReadFieldError 3279 } 3280 } else { 3281 if err = iprot.Skip(fieldTypeId); err != nil { 3282 goto SkipFieldError 3283 } 3284 } 3285 case 7: 3286 if fieldTypeId == thrift.STRING { 3287 if err = p.ReadField7(iprot); err != nil { 3288 goto ReadFieldError 3289 } 3290 issetEx4 = true 3291 } else { 3292 if err = iprot.Skip(fieldTypeId); err != nil { 3293 goto SkipFieldError 3294 } 3295 } 3296 case 9: 3297 if fieldTypeId == thrift.STRUCT { 3298 if err = p.ReadField9(iprot); err != nil { 3299 goto ReadFieldError 3300 } 3301 } else { 3302 if err = iprot.Skip(fieldTypeId); err != nil { 3303 goto SkipFieldError 3304 } 3305 } 3306 case 255: 3307 if fieldTypeId == thrift.STRUCT { 3308 if err = p.ReadField255(iprot); err != nil { 3309 goto ReadFieldError 3310 } 3311 issetBase = true 3312 } else { 3313 if err = iprot.Skip(fieldTypeId); err != nil { 3314 goto SkipFieldError 3315 } 3316 } 3317 case 32767: 3318 if fieldTypeId == thrift.DOUBLE { 3319 if err = p.ReadField32767(iprot); err != nil { 3320 goto ReadFieldError 3321 } 3322 } else { 3323 if err = iprot.Skip(fieldTypeId); err != nil { 3324 goto SkipFieldError 3325 } 3326 } 3327 default: 3328 if err = iprot.Skip(fieldTypeId); err != nil { 3329 goto SkipFieldError 3330 } 3331 } 3332 3333 if err = iprot.ReadFieldEnd(); err != nil { 3334 goto ReadFieldEndError 3335 } 3336 } 3337 if err = iprot.ReadStructEnd(); err != nil { 3338 goto ReadStructEndError 3339 } 3340 3341 if !issetEx4 { 3342 fieldId = 7 3343 goto RequiredFieldNotSetError 3344 } 3345 3346 if !issetBase { 3347 fieldId = 255 3348 goto RequiredFieldNotSetError 3349 } 3350 return nil 3351 ReadStructBeginError: 3352 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 3353 ReadFieldBeginError: 3354 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 3355 ReadFieldError: 3356 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleSuper[fieldId]), err) 3357 SkipFieldError: 3358 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 3359 3360 ReadFieldEndError: 3361 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 3362 ReadStructEndError: 3363 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3364 RequiredFieldNotSetError: 3365 return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field %s is not set", fieldIDToName_ExampleSuper[fieldId])) 3366 } 3367 3368 func (p *ExampleSuper) ReadField1(iprot thrift.TProtocol) error { 3369 if v, err := iprot.ReadString(); err != nil { 3370 return err 3371 } else { 3372 p.Msg = &v 3373 } 3374 return nil 3375 } 3376 3377 func (p *ExampleSuper) ReadField2(iprot thrift.TProtocol) error { 3378 if v, err := iprot.ReadI32(); err != nil { 3379 return err 3380 } else { 3381 p.A = &v 3382 } 3383 return nil 3384 } 3385 3386 func (p *ExampleSuper) ReadField3(iprot thrift.TProtocol) error { 3387 p.InnerBase = NewInnerBase() 3388 if err := p.InnerBase.Read(iprot); err != nil { 3389 return err 3390 } 3391 return nil 3392 } 3393 3394 func (p *ExampleSuper) ReadField4(iprot thrift.TProtocol) error { 3395 if v, err := iprot.ReadString(); err != nil { 3396 return err 3397 } else { 3398 p.Ex1 = v 3399 } 3400 return nil 3401 } 3402 3403 func (p *ExampleSuper) ReadField5(iprot thrift.TProtocol) error { 3404 if v, err := iprot.ReadString(); err != nil { 3405 return err 3406 } else { 3407 p.Ex2 = &v 3408 } 3409 return nil 3410 } 3411 3412 func (p *ExampleSuper) ReadField6(iprot thrift.TProtocol) error { 3413 if v, err := iprot.ReadString(); err != nil { 3414 return err 3415 } else { 3416 p.Ex3 = &v 3417 } 3418 return nil 3419 } 3420 3421 func (p *ExampleSuper) ReadField7(iprot thrift.TProtocol) error { 3422 if v, err := iprot.ReadString(); err != nil { 3423 return err 3424 } else { 3425 p.Ex4 = v 3426 } 3427 return nil 3428 } 3429 3430 func (p *ExampleSuper) ReadField9(iprot thrift.TProtocol) error { 3431 p.SelfRef = NewSelfRef() 3432 if err := p.SelfRef.Read(iprot); err != nil { 3433 return err 3434 } 3435 return nil 3436 } 3437 3438 func (p *ExampleSuper) ReadField255(iprot thrift.TProtocol) error { 3439 p.Base = base.NewBase() 3440 if err := p.Base.Read(iprot); err != nil { 3441 return err 3442 } 3443 return nil 3444 } 3445 3446 func (p *ExampleSuper) ReadField32767(iprot thrift.TProtocol) error { 3447 if v, err := iprot.ReadDouble(); err != nil { 3448 return err 3449 } else { 3450 p.Subfix = v 3451 } 3452 return nil 3453 } 3454 3455 func (p *ExampleSuper) Write(oprot thrift.TProtocol) (err error) { 3456 var fieldId int16 3457 if err = oprot.WriteStructBegin("ExampleSuper"); err != nil { 3458 goto WriteStructBeginError 3459 } 3460 if p != nil { 3461 if err = p.writeField1(oprot); err != nil { 3462 fieldId = 1 3463 goto WriteFieldError 3464 } 3465 if err = p.writeField2(oprot); err != nil { 3466 fieldId = 2 3467 goto WriteFieldError 3468 } 3469 if err = p.writeField3(oprot); err != nil { 3470 fieldId = 3 3471 goto WriteFieldError 3472 } 3473 if err = p.writeField4(oprot); err != nil { 3474 fieldId = 4 3475 goto WriteFieldError 3476 } 3477 if err = p.writeField5(oprot); err != nil { 3478 fieldId = 5 3479 goto WriteFieldError 3480 } 3481 if err = p.writeField6(oprot); err != nil { 3482 fieldId = 6 3483 goto WriteFieldError 3484 } 3485 if err = p.writeField7(oprot); err != nil { 3486 fieldId = 7 3487 goto WriteFieldError 3488 } 3489 if err = p.writeField9(oprot); err != nil { 3490 fieldId = 9 3491 goto WriteFieldError 3492 } 3493 if err = p.writeField255(oprot); err != nil { 3494 fieldId = 255 3495 goto WriteFieldError 3496 } 3497 if err = p.writeField32767(oprot); err != nil { 3498 fieldId = 32767 3499 goto WriteFieldError 3500 } 3501 3502 } 3503 if err = oprot.WriteFieldStop(); err != nil { 3504 goto WriteFieldStopError 3505 } 3506 if err = oprot.WriteStructEnd(); err != nil { 3507 goto WriteStructEndError 3508 } 3509 return nil 3510 WriteStructBeginError: 3511 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3512 WriteFieldError: 3513 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 3514 WriteFieldStopError: 3515 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 3516 WriteStructEndError: 3517 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 3518 } 3519 3520 func (p *ExampleSuper) writeField1(oprot thrift.TProtocol) (err error) { 3521 if p.IsSetMsg() { 3522 if err = oprot.WriteFieldBegin("Msg", thrift.STRING, 1); err != nil { 3523 goto WriteFieldBeginError 3524 } 3525 if err := oprot.WriteString(*p.Msg); err != nil { 3526 return err 3527 } 3528 if err = oprot.WriteFieldEnd(); err != nil { 3529 goto WriteFieldEndError 3530 } 3531 } 3532 return nil 3533 WriteFieldBeginError: 3534 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 3535 WriteFieldEndError: 3536 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 3537 } 3538 3539 func (p *ExampleSuper) writeField2(oprot thrift.TProtocol) (err error) { 3540 if p.IsSetA() { 3541 if err = oprot.WriteFieldBegin("A", thrift.I32, 2); err != nil { 3542 goto WriteFieldBeginError 3543 } 3544 if err := oprot.WriteI32(*p.A); err != nil { 3545 return err 3546 } 3547 if err = oprot.WriteFieldEnd(); err != nil { 3548 goto WriteFieldEndError 3549 } 3550 } 3551 return nil 3552 WriteFieldBeginError: 3553 return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) 3554 WriteFieldEndError: 3555 return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) 3556 } 3557 3558 func (p *ExampleSuper) writeField3(oprot thrift.TProtocol) (err error) { 3559 if err = oprot.WriteFieldBegin("InnerBase", thrift.STRUCT, 3); err != nil { 3560 goto WriteFieldBeginError 3561 } 3562 if err := p.InnerBase.Write(oprot); err != nil { 3563 return err 3564 } 3565 if err = oprot.WriteFieldEnd(); err != nil { 3566 goto WriteFieldEndError 3567 } 3568 return nil 3569 WriteFieldBeginError: 3570 return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) 3571 WriteFieldEndError: 3572 return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) 3573 } 3574 3575 func (p *ExampleSuper) writeField4(oprot thrift.TProtocol) (err error) { 3576 if err = oprot.WriteFieldBegin("Ex1", thrift.STRING, 4); err != nil { 3577 goto WriteFieldBeginError 3578 } 3579 if err := oprot.WriteString(p.Ex1); err != nil { 3580 return err 3581 } 3582 if err = oprot.WriteFieldEnd(); err != nil { 3583 goto WriteFieldEndError 3584 } 3585 return nil 3586 WriteFieldBeginError: 3587 return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) 3588 WriteFieldEndError: 3589 return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) 3590 } 3591 3592 func (p *ExampleSuper) writeField5(oprot thrift.TProtocol) (err error) { 3593 if p.IsSetEx2() { 3594 if err = oprot.WriteFieldBegin("Ex2", thrift.STRING, 5); err != nil { 3595 goto WriteFieldBeginError 3596 } 3597 if err := oprot.WriteString(*p.Ex2); err != nil { 3598 return err 3599 } 3600 if err = oprot.WriteFieldEnd(); err != nil { 3601 goto WriteFieldEndError 3602 } 3603 } 3604 return nil 3605 WriteFieldBeginError: 3606 return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) 3607 WriteFieldEndError: 3608 return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) 3609 } 3610 3611 func (p *ExampleSuper) writeField6(oprot thrift.TProtocol) (err error) { 3612 if p.IsSetEx3() { 3613 if err = oprot.WriteFieldBegin("Ex3", thrift.STRING, 6); err != nil { 3614 goto WriteFieldBeginError 3615 } 3616 if err := oprot.WriteString(*p.Ex3); err != nil { 3617 return err 3618 } 3619 if err = oprot.WriteFieldEnd(); err != nil { 3620 goto WriteFieldEndError 3621 } 3622 } 3623 return nil 3624 WriteFieldBeginError: 3625 return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) 3626 WriteFieldEndError: 3627 return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) 3628 } 3629 3630 func (p *ExampleSuper) writeField7(oprot thrift.TProtocol) (err error) { 3631 if err = oprot.WriteFieldBegin("Ex4", thrift.STRING, 7); err != nil { 3632 goto WriteFieldBeginError 3633 } 3634 if err := oprot.WriteString(p.Ex4); err != nil { 3635 return err 3636 } 3637 if err = oprot.WriteFieldEnd(); err != nil { 3638 goto WriteFieldEndError 3639 } 3640 return nil 3641 WriteFieldBeginError: 3642 return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) 3643 WriteFieldEndError: 3644 return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) 3645 } 3646 3647 func (p *ExampleSuper) writeField9(oprot thrift.TProtocol) (err error) { 3648 if err = oprot.WriteFieldBegin("SelfRef", thrift.STRUCT, 9); err != nil { 3649 goto WriteFieldBeginError 3650 } 3651 if err := p.SelfRef.Write(oprot); err != nil { 3652 return err 3653 } 3654 if err = oprot.WriteFieldEnd(); err != nil { 3655 goto WriteFieldEndError 3656 } 3657 return nil 3658 WriteFieldBeginError: 3659 return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) 3660 WriteFieldEndError: 3661 return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) 3662 } 3663 3664 func (p *ExampleSuper) writeField255(oprot thrift.TProtocol) (err error) { 3665 if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { 3666 goto WriteFieldBeginError 3667 } 3668 if err := p.Base.Write(oprot); err != nil { 3669 return err 3670 } 3671 if err = oprot.WriteFieldEnd(); err != nil { 3672 goto WriteFieldEndError 3673 } 3674 return nil 3675 WriteFieldBeginError: 3676 return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) 3677 WriteFieldEndError: 3678 return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) 3679 } 3680 3681 func (p *ExampleSuper) writeField32767(oprot thrift.TProtocol) (err error) { 3682 if err = oprot.WriteFieldBegin("Subfix", thrift.DOUBLE, 32767); err != nil { 3683 goto WriteFieldBeginError 3684 } 3685 if err := oprot.WriteDouble(p.Subfix); err != nil { 3686 return err 3687 } 3688 if err = oprot.WriteFieldEnd(); err != nil { 3689 goto WriteFieldEndError 3690 } 3691 return nil 3692 WriteFieldBeginError: 3693 return thrift.PrependError(fmt.Sprintf("%T write field 32767 begin error: ", p), err) 3694 WriteFieldEndError: 3695 return thrift.PrependError(fmt.Sprintf("%T write field 32767 end error: ", p), err) 3696 } 3697 3698 func (p *ExampleSuper) String() string { 3699 if p == nil { 3700 return "<nil>" 3701 } 3702 return fmt.Sprintf("ExampleSuper(%+v)", *p) 3703 } 3704 3705 func (p *ExampleSuper) DeepEqual(ano *ExampleSuper) bool { 3706 if p == ano { 3707 return true 3708 } else if p == nil || ano == nil { 3709 return false 3710 } 3711 if !p.Field1DeepEqual(ano.Msg) { 3712 return false 3713 } 3714 if !p.Field2DeepEqual(ano.A) { 3715 return false 3716 } 3717 if !p.Field3DeepEqual(ano.InnerBase) { 3718 return false 3719 } 3720 if !p.Field4DeepEqual(ano.Ex1) { 3721 return false 3722 } 3723 if !p.Field5DeepEqual(ano.Ex2) { 3724 return false 3725 } 3726 if !p.Field6DeepEqual(ano.Ex3) { 3727 return false 3728 } 3729 if !p.Field7DeepEqual(ano.Ex4) { 3730 return false 3731 } 3732 if !p.Field9DeepEqual(ano.SelfRef) { 3733 return false 3734 } 3735 if !p.Field255DeepEqual(ano.Base) { 3736 return false 3737 } 3738 if !p.Field32767DeepEqual(ano.Subfix) { 3739 return false 3740 } 3741 return true 3742 } 3743 3744 func (p *ExampleSuper) Field1DeepEqual(src *string) bool { 3745 3746 if p.Msg == src { 3747 return true 3748 } else if p.Msg == nil || src == nil { 3749 return false 3750 } 3751 if strings.Compare(*p.Msg, *src) != 0 { 3752 return false 3753 } 3754 return true 3755 } 3756 func (p *ExampleSuper) Field2DeepEqual(src *int32) bool { 3757 3758 if p.A == src { 3759 return true 3760 } else if p.A == nil || src == nil { 3761 return false 3762 } 3763 if *p.A != *src { 3764 return false 3765 } 3766 return true 3767 } 3768 func (p *ExampleSuper) Field3DeepEqual(src *InnerBase) bool { 3769 3770 if !p.InnerBase.DeepEqual(src) { 3771 return false 3772 } 3773 return true 3774 } 3775 func (p *ExampleSuper) Field4DeepEqual(src string) bool { 3776 3777 if strings.Compare(p.Ex1, src) != 0 { 3778 return false 3779 } 3780 return true 3781 } 3782 func (p *ExampleSuper) Field5DeepEqual(src *string) bool { 3783 3784 if p.Ex2 == src { 3785 return true 3786 } else if p.Ex2 == nil || src == nil { 3787 return false 3788 } 3789 if strings.Compare(*p.Ex2, *src) != 0 { 3790 return false 3791 } 3792 return true 3793 } 3794 func (p *ExampleSuper) Field6DeepEqual(src *string) bool { 3795 3796 if p.Ex3 == src { 3797 return true 3798 } else if p.Ex3 == nil || src == nil { 3799 return false 3800 } 3801 if strings.Compare(*p.Ex3, *src) != 0 { 3802 return false 3803 } 3804 return true 3805 } 3806 func (p *ExampleSuper) Field7DeepEqual(src string) bool { 3807 3808 if strings.Compare(p.Ex4, src) != 0 { 3809 return false 3810 } 3811 return true 3812 } 3813 func (p *ExampleSuper) Field9DeepEqual(src *SelfRef) bool { 3814 3815 if !p.SelfRef.DeepEqual(src) { 3816 return false 3817 } 3818 return true 3819 } 3820 func (p *ExampleSuper) Field255DeepEqual(src *base.Base) bool { 3821 3822 if !p.Base.DeepEqual(src) { 3823 return false 3824 } 3825 return true 3826 } 3827 func (p *ExampleSuper) Field32767DeepEqual(src float64) bool { 3828 3829 if p.Subfix != src { 3830 return false 3831 } 3832 return true 3833 } 3834 3835 type SelfRef struct { 3836 Self *SelfRef `thrift:"self,1" json:"self,omitempty"` 3837 } 3838 3839 func NewSelfRef() *SelfRef { 3840 return &SelfRef{} 3841 } 3842 3843 var SelfRef_Self_DEFAULT *SelfRef 3844 3845 func (p *SelfRef) GetSelf() (v *SelfRef) { 3846 if !p.IsSetSelf() { 3847 return SelfRef_Self_DEFAULT 3848 } 3849 return p.Self 3850 } 3851 func (p *SelfRef) SetSelf(val *SelfRef) { 3852 p.Self = val 3853 } 3854 3855 var fieldIDToName_SelfRef = map[int16]string{ 3856 1: "self", 3857 } 3858 3859 func (p *SelfRef) IsSetSelf() bool { 3860 return p.Self != nil 3861 } 3862 3863 func (p *SelfRef) Read(iprot thrift.TProtocol) (err error) { 3864 3865 var fieldTypeId thrift.TType 3866 var fieldId int16 3867 3868 if _, err = iprot.ReadStructBegin(); err != nil { 3869 goto ReadStructBeginError 3870 } 3871 3872 for { 3873 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 3874 if err != nil { 3875 goto ReadFieldBeginError 3876 } 3877 if fieldTypeId == thrift.STOP { 3878 break 3879 } 3880 3881 switch fieldId { 3882 case 1: 3883 if fieldTypeId == thrift.STRUCT { 3884 if err = p.ReadField1(iprot); err != nil { 3885 goto ReadFieldError 3886 } 3887 } else { 3888 if err = iprot.Skip(fieldTypeId); err != nil { 3889 goto SkipFieldError 3890 } 3891 } 3892 default: 3893 if err = iprot.Skip(fieldTypeId); err != nil { 3894 goto SkipFieldError 3895 } 3896 } 3897 3898 if err = iprot.ReadFieldEnd(); err != nil { 3899 goto ReadFieldEndError 3900 } 3901 } 3902 if err = iprot.ReadStructEnd(); err != nil { 3903 goto ReadStructEndError 3904 } 3905 3906 return nil 3907 ReadStructBeginError: 3908 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 3909 ReadFieldBeginError: 3910 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 3911 ReadFieldError: 3912 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SelfRef[fieldId]), err) 3913 SkipFieldError: 3914 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 3915 3916 ReadFieldEndError: 3917 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 3918 ReadStructEndError: 3919 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 3920 } 3921 3922 func (p *SelfRef) ReadField1(iprot thrift.TProtocol) error { 3923 p.Self = NewSelfRef() 3924 if err := p.Self.Read(iprot); err != nil { 3925 return err 3926 } 3927 return nil 3928 } 3929 3930 func (p *SelfRef) Write(oprot thrift.TProtocol) (err error) { 3931 var fieldId int16 3932 if err = oprot.WriteStructBegin("SelfRef"); err != nil { 3933 goto WriteStructBeginError 3934 } 3935 if p != nil { 3936 if err = p.writeField1(oprot); err != nil { 3937 fieldId = 1 3938 goto WriteFieldError 3939 } 3940 3941 } 3942 if err = oprot.WriteFieldStop(); err != nil { 3943 goto WriteFieldStopError 3944 } 3945 if err = oprot.WriteStructEnd(); err != nil { 3946 goto WriteStructEndError 3947 } 3948 return nil 3949 WriteStructBeginError: 3950 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 3951 WriteFieldError: 3952 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 3953 WriteFieldStopError: 3954 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 3955 WriteStructEndError: 3956 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 3957 } 3958 3959 func (p *SelfRef) writeField1(oprot thrift.TProtocol) (err error) { 3960 if p.IsSetSelf() { 3961 if err = oprot.WriteFieldBegin("self", thrift.STRUCT, 1); err != nil { 3962 goto WriteFieldBeginError 3963 } 3964 if err := p.Self.Write(oprot); err != nil { 3965 return err 3966 } 3967 if err = oprot.WriteFieldEnd(); err != nil { 3968 goto WriteFieldEndError 3969 } 3970 } 3971 return nil 3972 WriteFieldBeginError: 3973 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 3974 WriteFieldEndError: 3975 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 3976 } 3977 3978 func (p *SelfRef) String() string { 3979 if p == nil { 3980 return "<nil>" 3981 } 3982 return fmt.Sprintf("SelfRef(%+v)", *p) 3983 } 3984 3985 func (p *SelfRef) DeepEqual(ano *SelfRef) bool { 3986 if p == ano { 3987 return true 3988 } else if p == nil || ano == nil { 3989 return false 3990 } 3991 if !p.Field1DeepEqual(ano.Self) { 3992 return false 3993 } 3994 return true 3995 } 3996 3997 func (p *SelfRef) Field1DeepEqual(src *SelfRef) bool { 3998 3999 if !p.Self.DeepEqual(src) { 4000 return false 4001 } 4002 return true 4003 } 4004 4005 type ExampleReqPartial struct { 4006 Msg *string `thrift:"Msg,1" json:"Msg,omitempty"` 4007 InnerBase *InnerBasePartial `thrift:"InnerBase,3" json:"InnerBase"` 4008 Base *BasePartial `thrift:"Base,255" json:"Base"` 4009 } 4010 4011 func NewExampleReqPartial() *ExampleReqPartial { 4012 return &ExampleReqPartial{} 4013 } 4014 4015 var ExampleReqPartial_Msg_DEFAULT string 4016 4017 func (p *ExampleReqPartial) GetMsg() (v string) { 4018 if !p.IsSetMsg() { 4019 return ExampleReqPartial_Msg_DEFAULT 4020 } 4021 return *p.Msg 4022 } 4023 4024 var ExampleReqPartial_InnerBase_DEFAULT *InnerBasePartial 4025 4026 func (p *ExampleReqPartial) GetInnerBase() (v *InnerBasePartial) { 4027 if !p.IsSetInnerBase() { 4028 return ExampleReqPartial_InnerBase_DEFAULT 4029 } 4030 return p.InnerBase 4031 } 4032 4033 var ExampleReqPartial_Base_DEFAULT *BasePartial 4034 4035 func (p *ExampleReqPartial) GetBase() (v *BasePartial) { 4036 if !p.IsSetBase() { 4037 return ExampleReqPartial_Base_DEFAULT 4038 } 4039 return p.Base 4040 } 4041 func (p *ExampleReqPartial) SetMsg(val *string) { 4042 p.Msg = val 4043 } 4044 func (p *ExampleReqPartial) SetInnerBase(val *InnerBasePartial) { 4045 p.InnerBase = val 4046 } 4047 func (p *ExampleReqPartial) SetBase(val *BasePartial) { 4048 p.Base = val 4049 } 4050 4051 var fieldIDToName_ExampleReqPartial = map[int16]string{ 4052 1: "Msg", 4053 3: "InnerBase", 4054 255: "Base", 4055 } 4056 4057 func (p *ExampleReqPartial) IsSetMsg() bool { 4058 return p.Msg != nil 4059 } 4060 4061 func (p *ExampleReqPartial) IsSetInnerBase() bool { 4062 return p.InnerBase != nil 4063 } 4064 4065 func (p *ExampleReqPartial) IsSetBase() bool { 4066 return p.Base != nil 4067 } 4068 4069 func (p *ExampleReqPartial) Read(iprot thrift.TProtocol) (err error) { 4070 4071 var fieldTypeId thrift.TType 4072 var fieldId int16 4073 4074 if _, err = iprot.ReadStructBegin(); err != nil { 4075 goto ReadStructBeginError 4076 } 4077 4078 for { 4079 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 4080 if err != nil { 4081 goto ReadFieldBeginError 4082 } 4083 if fieldTypeId == thrift.STOP { 4084 break 4085 } 4086 4087 switch fieldId { 4088 case 1: 4089 if fieldTypeId == thrift.STRING { 4090 if err = p.ReadField1(iprot); err != nil { 4091 goto ReadFieldError 4092 } 4093 } else { 4094 if err = iprot.Skip(fieldTypeId); err != nil { 4095 goto SkipFieldError 4096 } 4097 } 4098 case 3: 4099 if fieldTypeId == thrift.STRUCT { 4100 if err = p.ReadField3(iprot); err != nil { 4101 goto ReadFieldError 4102 } 4103 } else { 4104 if err = iprot.Skip(fieldTypeId); err != nil { 4105 goto SkipFieldError 4106 } 4107 } 4108 case 255: 4109 if fieldTypeId == thrift.STRUCT { 4110 if err = p.ReadField255(iprot); err != nil { 4111 goto ReadFieldError 4112 } 4113 } else { 4114 if err = iprot.Skip(fieldTypeId); err != nil { 4115 goto SkipFieldError 4116 } 4117 } 4118 default: 4119 if err = iprot.Skip(fieldTypeId); err != nil { 4120 goto SkipFieldError 4121 } 4122 } 4123 4124 if err = iprot.ReadFieldEnd(); err != nil { 4125 goto ReadFieldEndError 4126 } 4127 } 4128 if err = iprot.ReadStructEnd(); err != nil { 4129 goto ReadStructEndError 4130 } 4131 4132 return nil 4133 ReadStructBeginError: 4134 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 4135 ReadFieldBeginError: 4136 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 4137 ReadFieldError: 4138 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleReqPartial[fieldId]), err) 4139 SkipFieldError: 4140 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 4141 4142 ReadFieldEndError: 4143 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 4144 ReadStructEndError: 4145 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4146 } 4147 4148 func (p *ExampleReqPartial) ReadField1(iprot thrift.TProtocol) error { 4149 if v, err := iprot.ReadString(); err != nil { 4150 return err 4151 } else { 4152 p.Msg = &v 4153 } 4154 return nil 4155 } 4156 4157 func (p *ExampleReqPartial) ReadField3(iprot thrift.TProtocol) error { 4158 p.InnerBase = NewInnerBasePartial() 4159 if err := p.InnerBase.Read(iprot); err != nil { 4160 return err 4161 } 4162 return nil 4163 } 4164 4165 func (p *ExampleReqPartial) ReadField255(iprot thrift.TProtocol) error { 4166 p.Base = NewBasePartial() 4167 if err := p.Base.Read(iprot); err != nil { 4168 return err 4169 } 4170 return nil 4171 } 4172 4173 func (p *ExampleReqPartial) Write(oprot thrift.TProtocol) (err error) { 4174 var fieldId int16 4175 if err = oprot.WriteStructBegin("ExampleReqPartial"); err != nil { 4176 goto WriteStructBeginError 4177 } 4178 if p != nil { 4179 if err = p.writeField1(oprot); err != nil { 4180 fieldId = 1 4181 goto WriteFieldError 4182 } 4183 if err = p.writeField3(oprot); err != nil { 4184 fieldId = 3 4185 goto WriteFieldError 4186 } 4187 if err = p.writeField255(oprot); err != nil { 4188 fieldId = 255 4189 goto WriteFieldError 4190 } 4191 4192 } 4193 if err = oprot.WriteFieldStop(); err != nil { 4194 goto WriteFieldStopError 4195 } 4196 if err = oprot.WriteStructEnd(); err != nil { 4197 goto WriteStructEndError 4198 } 4199 return nil 4200 WriteStructBeginError: 4201 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4202 WriteFieldError: 4203 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 4204 WriteFieldStopError: 4205 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 4206 WriteStructEndError: 4207 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 4208 } 4209 4210 func (p *ExampleReqPartial) writeField1(oprot thrift.TProtocol) (err error) { 4211 if p.IsSetMsg() { 4212 if err = oprot.WriteFieldBegin("Msg", thrift.STRING, 1); err != nil { 4213 goto WriteFieldBeginError 4214 } 4215 if err := oprot.WriteString(*p.Msg); err != nil { 4216 return err 4217 } 4218 if err = oprot.WriteFieldEnd(); err != nil { 4219 goto WriteFieldEndError 4220 } 4221 } 4222 return nil 4223 WriteFieldBeginError: 4224 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 4225 WriteFieldEndError: 4226 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 4227 } 4228 4229 func (p *ExampleReqPartial) writeField3(oprot thrift.TProtocol) (err error) { 4230 if err = oprot.WriteFieldBegin("InnerBase", thrift.STRUCT, 3); err != nil { 4231 goto WriteFieldBeginError 4232 } 4233 if err := p.InnerBase.Write(oprot); err != nil { 4234 return err 4235 } 4236 if err = oprot.WriteFieldEnd(); err != nil { 4237 goto WriteFieldEndError 4238 } 4239 return nil 4240 WriteFieldBeginError: 4241 return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) 4242 WriteFieldEndError: 4243 return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) 4244 } 4245 4246 func (p *ExampleReqPartial) writeField255(oprot thrift.TProtocol) (err error) { 4247 if err = oprot.WriteFieldBegin("Base", thrift.STRUCT, 255); err != nil { 4248 goto WriteFieldBeginError 4249 } 4250 if err := p.Base.Write(oprot); err != nil { 4251 return err 4252 } 4253 if err = oprot.WriteFieldEnd(); err != nil { 4254 goto WriteFieldEndError 4255 } 4256 return nil 4257 WriteFieldBeginError: 4258 return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) 4259 WriteFieldEndError: 4260 return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) 4261 } 4262 4263 func (p *ExampleReqPartial) String() string { 4264 if p == nil { 4265 return "<nil>" 4266 } 4267 return fmt.Sprintf("ExampleReqPartial(%+v)", *p) 4268 } 4269 4270 func (p *ExampleReqPartial) DeepEqual(ano *ExampleReqPartial) bool { 4271 if p == ano { 4272 return true 4273 } else if p == nil || ano == nil { 4274 return false 4275 } 4276 if !p.Field1DeepEqual(ano.Msg) { 4277 return false 4278 } 4279 if !p.Field3DeepEqual(ano.InnerBase) { 4280 return false 4281 } 4282 if !p.Field255DeepEqual(ano.Base) { 4283 return false 4284 } 4285 return true 4286 } 4287 4288 func (p *ExampleReqPartial) Field1DeepEqual(src *string) bool { 4289 4290 if p.Msg == src { 4291 return true 4292 } else if p.Msg == nil || src == nil { 4293 return false 4294 } 4295 if strings.Compare(*p.Msg, *src) != 0 { 4296 return false 4297 } 4298 return true 4299 } 4300 func (p *ExampleReqPartial) Field3DeepEqual(src *InnerBasePartial) bool { 4301 4302 if !p.InnerBase.DeepEqual(src) { 4303 return false 4304 } 4305 return true 4306 } 4307 func (p *ExampleReqPartial) Field255DeepEqual(src *BasePartial) bool { 4308 4309 if !p.Base.DeepEqual(src) { 4310 return false 4311 } 4312 return true 4313 } 4314 4315 type ExampleResp struct { 4316 Msg *string `thrift:"Msg,1" json:"Msg,omitempty"` 4317 RequiredField string `thrift:"required_field,2,required" json:"required_field"` 4318 BaseResp *base.BaseResp `thrift:"BaseResp,255" json:"BaseResp"` 4319 } 4320 4321 func NewExampleResp() *ExampleResp { 4322 return &ExampleResp{} 4323 } 4324 4325 var ExampleResp_Msg_DEFAULT string 4326 4327 func (p *ExampleResp) GetMsg() (v string) { 4328 if !p.IsSetMsg() { 4329 return ExampleResp_Msg_DEFAULT 4330 } 4331 return *p.Msg 4332 } 4333 4334 func (p *ExampleResp) GetRequiredField() (v string) { 4335 return p.RequiredField 4336 } 4337 4338 var ExampleResp_BaseResp_DEFAULT *base.BaseResp 4339 4340 func (p *ExampleResp) GetBaseResp() (v *base.BaseResp) { 4341 if !p.IsSetBaseResp() { 4342 return ExampleResp_BaseResp_DEFAULT 4343 } 4344 return p.BaseResp 4345 } 4346 func (p *ExampleResp) SetMsg(val *string) { 4347 p.Msg = val 4348 } 4349 func (p *ExampleResp) SetRequiredField(val string) { 4350 p.RequiredField = val 4351 } 4352 func (p *ExampleResp) SetBaseResp(val *base.BaseResp) { 4353 p.BaseResp = val 4354 } 4355 4356 var fieldIDToName_ExampleResp = map[int16]string{ 4357 1: "Msg", 4358 2: "required_field", 4359 255: "BaseResp", 4360 } 4361 4362 func (p *ExampleResp) IsSetMsg() bool { 4363 return p.Msg != nil 4364 } 4365 4366 func (p *ExampleResp) IsSetBaseResp() bool { 4367 return p.BaseResp != nil 4368 } 4369 4370 func (p *ExampleResp) Read(iprot thrift.TProtocol) (err error) { 4371 4372 var fieldTypeId thrift.TType 4373 var fieldId int16 4374 var issetRequiredField bool = false 4375 4376 if _, err = iprot.ReadStructBegin(); err != nil { 4377 goto ReadStructBeginError 4378 } 4379 4380 for { 4381 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 4382 if err != nil { 4383 goto ReadFieldBeginError 4384 } 4385 if fieldTypeId == thrift.STOP { 4386 break 4387 } 4388 4389 switch fieldId { 4390 case 1: 4391 if fieldTypeId == thrift.STRING { 4392 if err = p.ReadField1(iprot); err != nil { 4393 goto ReadFieldError 4394 } 4395 } else { 4396 if err = iprot.Skip(fieldTypeId); err != nil { 4397 goto SkipFieldError 4398 } 4399 } 4400 case 2: 4401 if fieldTypeId == thrift.STRING { 4402 if err = p.ReadField2(iprot); err != nil { 4403 goto ReadFieldError 4404 } 4405 issetRequiredField = true 4406 } else { 4407 if err = iprot.Skip(fieldTypeId); err != nil { 4408 goto SkipFieldError 4409 } 4410 } 4411 case 255: 4412 if fieldTypeId == thrift.STRUCT { 4413 if err = p.ReadField255(iprot); err != nil { 4414 goto ReadFieldError 4415 } 4416 } else { 4417 if err = iprot.Skip(fieldTypeId); err != nil { 4418 goto SkipFieldError 4419 } 4420 } 4421 default: 4422 if err = iprot.Skip(fieldTypeId); err != nil { 4423 goto SkipFieldError 4424 } 4425 } 4426 4427 if err = iprot.ReadFieldEnd(); err != nil { 4428 goto ReadFieldEndError 4429 } 4430 } 4431 if err = iprot.ReadStructEnd(); err != nil { 4432 goto ReadStructEndError 4433 } 4434 4435 if !issetRequiredField { 4436 fieldId = 2 4437 goto RequiredFieldNotSetError 4438 } 4439 return nil 4440 ReadStructBeginError: 4441 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 4442 ReadFieldBeginError: 4443 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 4444 ReadFieldError: 4445 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleResp[fieldId]), err) 4446 SkipFieldError: 4447 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 4448 4449 ReadFieldEndError: 4450 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 4451 ReadStructEndError: 4452 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4453 RequiredFieldNotSetError: 4454 return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field %s is not set", fieldIDToName_ExampleResp[fieldId])) 4455 } 4456 4457 func (p *ExampleResp) ReadField1(iprot thrift.TProtocol) error { 4458 if v, err := iprot.ReadString(); err != nil { 4459 return err 4460 } else { 4461 p.Msg = &v 4462 } 4463 return nil 4464 } 4465 4466 func (p *ExampleResp) ReadField2(iprot thrift.TProtocol) error { 4467 if v, err := iprot.ReadString(); err != nil { 4468 return err 4469 } else { 4470 p.RequiredField = v 4471 } 4472 return nil 4473 } 4474 4475 func (p *ExampleResp) ReadField255(iprot thrift.TProtocol) error { 4476 p.BaseResp = base.NewBaseResp() 4477 if err := p.BaseResp.Read(iprot); err != nil { 4478 return err 4479 } 4480 return nil 4481 } 4482 4483 func (p *ExampleResp) Write(oprot thrift.TProtocol) (err error) { 4484 var fieldId int16 4485 if err = oprot.WriteStructBegin("ExampleResp"); err != nil { 4486 goto WriteStructBeginError 4487 } 4488 if p != nil { 4489 if err = p.writeField1(oprot); err != nil { 4490 fieldId = 1 4491 goto WriteFieldError 4492 } 4493 if err = p.writeField2(oprot); err != nil { 4494 fieldId = 2 4495 goto WriteFieldError 4496 } 4497 if err = p.writeField255(oprot); err != nil { 4498 fieldId = 255 4499 goto WriteFieldError 4500 } 4501 4502 } 4503 if err = oprot.WriteFieldStop(); err != nil { 4504 goto WriteFieldStopError 4505 } 4506 if err = oprot.WriteStructEnd(); err != nil { 4507 goto WriteStructEndError 4508 } 4509 return nil 4510 WriteStructBeginError: 4511 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4512 WriteFieldError: 4513 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 4514 WriteFieldStopError: 4515 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 4516 WriteStructEndError: 4517 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 4518 } 4519 4520 func (p *ExampleResp) writeField1(oprot thrift.TProtocol) (err error) { 4521 if p.IsSetMsg() { 4522 if err = oprot.WriteFieldBegin("Msg", thrift.STRING, 1); err != nil { 4523 goto WriteFieldBeginError 4524 } 4525 if err := oprot.WriteString(*p.Msg); err != nil { 4526 return err 4527 } 4528 if err = oprot.WriteFieldEnd(); err != nil { 4529 goto WriteFieldEndError 4530 } 4531 } 4532 return nil 4533 WriteFieldBeginError: 4534 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 4535 WriteFieldEndError: 4536 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 4537 } 4538 4539 func (p *ExampleResp) writeField2(oprot thrift.TProtocol) (err error) { 4540 if err = oprot.WriteFieldBegin("required_field", thrift.STRING, 2); err != nil { 4541 goto WriteFieldBeginError 4542 } 4543 if err := oprot.WriteString(p.RequiredField); err != nil { 4544 return err 4545 } 4546 if err = oprot.WriteFieldEnd(); err != nil { 4547 goto WriteFieldEndError 4548 } 4549 return nil 4550 WriteFieldBeginError: 4551 return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) 4552 WriteFieldEndError: 4553 return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) 4554 } 4555 4556 func (p *ExampleResp) writeField255(oprot thrift.TProtocol) (err error) { 4557 if err = oprot.WriteFieldBegin("BaseResp", thrift.STRUCT, 255); err != nil { 4558 goto WriteFieldBeginError 4559 } 4560 if err := p.BaseResp.Write(oprot); err != nil { 4561 return err 4562 } 4563 if err = oprot.WriteFieldEnd(); err != nil { 4564 goto WriteFieldEndError 4565 } 4566 return nil 4567 WriteFieldBeginError: 4568 return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) 4569 WriteFieldEndError: 4570 return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) 4571 } 4572 4573 func (p *ExampleResp) String() string { 4574 if p == nil { 4575 return "<nil>" 4576 } 4577 return fmt.Sprintf("ExampleResp(%+v)", *p) 4578 } 4579 4580 func (p *ExampleResp) DeepEqual(ano *ExampleResp) bool { 4581 if p == ano { 4582 return true 4583 } else if p == nil || ano == nil { 4584 return false 4585 } 4586 if !p.Field1DeepEqual(ano.Msg) { 4587 return false 4588 } 4589 if !p.Field2DeepEqual(ano.RequiredField) { 4590 return false 4591 } 4592 if !p.Field255DeepEqual(ano.BaseResp) { 4593 return false 4594 } 4595 return true 4596 } 4597 4598 func (p *ExampleResp) Field1DeepEqual(src *string) bool { 4599 4600 if p.Msg == src { 4601 return true 4602 } else if p.Msg == nil || src == nil { 4603 return false 4604 } 4605 if strings.Compare(*p.Msg, *src) != 0 { 4606 return false 4607 } 4608 return true 4609 } 4610 func (p *ExampleResp) Field2DeepEqual(src string) bool { 4611 4612 if strings.Compare(p.RequiredField, src) != 0 { 4613 return false 4614 } 4615 return true 4616 } 4617 func (p *ExampleResp) Field255DeepEqual(src *base.BaseResp) bool { 4618 4619 if !p.BaseResp.DeepEqual(src) { 4620 return false 4621 } 4622 return true 4623 } 4624 4625 type A struct { 4626 Self *A `thrift:"self,1" json:"self"` 4627 } 4628 4629 func NewA() *A { 4630 return &A{} 4631 } 4632 4633 var A_Self_DEFAULT *A 4634 4635 func (p *A) GetSelf() (v *A) { 4636 if !p.IsSetSelf() { 4637 return A_Self_DEFAULT 4638 } 4639 return p.Self 4640 } 4641 func (p *A) SetSelf(val *A) { 4642 p.Self = val 4643 } 4644 4645 var fieldIDToName_A = map[int16]string{ 4646 1: "self", 4647 } 4648 4649 func (p *A) IsSetSelf() bool { 4650 return p.Self != nil 4651 } 4652 4653 func (p *A) Read(iprot thrift.TProtocol) (err error) { 4654 4655 var fieldTypeId thrift.TType 4656 var fieldId int16 4657 4658 if _, err = iprot.ReadStructBegin(); err != nil { 4659 goto ReadStructBeginError 4660 } 4661 4662 for { 4663 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 4664 if err != nil { 4665 goto ReadFieldBeginError 4666 } 4667 if fieldTypeId == thrift.STOP { 4668 break 4669 } 4670 4671 switch fieldId { 4672 case 1: 4673 if fieldTypeId == thrift.STRUCT { 4674 if err = p.ReadField1(iprot); err != nil { 4675 goto ReadFieldError 4676 } 4677 } else { 4678 if err = iprot.Skip(fieldTypeId); err != nil { 4679 goto SkipFieldError 4680 } 4681 } 4682 default: 4683 if err = iprot.Skip(fieldTypeId); err != nil { 4684 goto SkipFieldError 4685 } 4686 } 4687 4688 if err = iprot.ReadFieldEnd(); err != nil { 4689 goto ReadFieldEndError 4690 } 4691 } 4692 if err = iprot.ReadStructEnd(); err != nil { 4693 goto ReadStructEndError 4694 } 4695 4696 return nil 4697 ReadStructBeginError: 4698 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 4699 ReadFieldBeginError: 4700 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 4701 ReadFieldError: 4702 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_A[fieldId]), err) 4703 SkipFieldError: 4704 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 4705 4706 ReadFieldEndError: 4707 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 4708 ReadStructEndError: 4709 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4710 } 4711 4712 func (p *A) ReadField1(iprot thrift.TProtocol) error { 4713 p.Self = NewA() 4714 if err := p.Self.Read(iprot); err != nil { 4715 return err 4716 } 4717 return nil 4718 } 4719 4720 func (p *A) Write(oprot thrift.TProtocol) (err error) { 4721 var fieldId int16 4722 if err = oprot.WriteStructBegin("A"); err != nil { 4723 goto WriteStructBeginError 4724 } 4725 if p != nil { 4726 if err = p.writeField1(oprot); err != nil { 4727 fieldId = 1 4728 goto WriteFieldError 4729 } 4730 4731 } 4732 if err = oprot.WriteFieldStop(); err != nil { 4733 goto WriteFieldStopError 4734 } 4735 if err = oprot.WriteStructEnd(); err != nil { 4736 goto WriteStructEndError 4737 } 4738 return nil 4739 WriteStructBeginError: 4740 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4741 WriteFieldError: 4742 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 4743 WriteFieldStopError: 4744 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 4745 WriteStructEndError: 4746 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 4747 } 4748 4749 func (p *A) writeField1(oprot thrift.TProtocol) (err error) { 4750 if err = oprot.WriteFieldBegin("self", thrift.STRUCT, 1); err != nil { 4751 goto WriteFieldBeginError 4752 } 4753 if err := p.Self.Write(oprot); err != nil { 4754 return err 4755 } 4756 if err = oprot.WriteFieldEnd(); err != nil { 4757 goto WriteFieldEndError 4758 } 4759 return nil 4760 WriteFieldBeginError: 4761 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 4762 WriteFieldEndError: 4763 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 4764 } 4765 4766 func (p *A) String() string { 4767 if p == nil { 4768 return "<nil>" 4769 } 4770 return fmt.Sprintf("A(%+v)", *p) 4771 } 4772 4773 func (p *A) DeepEqual(ano *A) bool { 4774 if p == ano { 4775 return true 4776 } else if p == nil || ano == nil { 4777 return false 4778 } 4779 if !p.Field1DeepEqual(ano.Self) { 4780 return false 4781 } 4782 return true 4783 } 4784 4785 func (p *A) Field1DeepEqual(src *A) bool { 4786 4787 if !p.Self.DeepEqual(src) { 4788 return false 4789 } 4790 return true 4791 } 4792 4793 type Exception struct { 4794 Code int32 `thrift:"code,1" json:"code"` 4795 Msg string `thrift:"msg,255" json:"msg"` 4796 } 4797 4798 func NewException() *Exception { 4799 return &Exception{} 4800 } 4801 4802 func (p *Exception) GetCode() (v int32) { 4803 return p.Code 4804 } 4805 4806 func (p *Exception) GetMsg() (v string) { 4807 return p.Msg 4808 } 4809 func (p *Exception) SetCode(val int32) { 4810 p.Code = val 4811 } 4812 func (p *Exception) SetMsg(val string) { 4813 p.Msg = val 4814 } 4815 4816 var fieldIDToName_Exception = map[int16]string{ 4817 1: "code", 4818 255: "msg", 4819 } 4820 4821 func (p *Exception) Read(iprot thrift.TProtocol) (err error) { 4822 4823 var fieldTypeId thrift.TType 4824 var fieldId int16 4825 4826 if _, err = iprot.ReadStructBegin(); err != nil { 4827 goto ReadStructBeginError 4828 } 4829 4830 for { 4831 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 4832 if err != nil { 4833 goto ReadFieldBeginError 4834 } 4835 if fieldTypeId == thrift.STOP { 4836 break 4837 } 4838 4839 switch fieldId { 4840 case 1: 4841 if fieldTypeId == thrift.I32 { 4842 if err = p.ReadField1(iprot); err != nil { 4843 goto ReadFieldError 4844 } 4845 } else { 4846 if err = iprot.Skip(fieldTypeId); err != nil { 4847 goto SkipFieldError 4848 } 4849 } 4850 case 255: 4851 if fieldTypeId == thrift.STRING { 4852 if err = p.ReadField255(iprot); err != nil { 4853 goto ReadFieldError 4854 } 4855 } else { 4856 if err = iprot.Skip(fieldTypeId); err != nil { 4857 goto SkipFieldError 4858 } 4859 } 4860 default: 4861 if err = iprot.Skip(fieldTypeId); err != nil { 4862 goto SkipFieldError 4863 } 4864 } 4865 4866 if err = iprot.ReadFieldEnd(); err != nil { 4867 goto ReadFieldEndError 4868 } 4869 } 4870 if err = iprot.ReadStructEnd(); err != nil { 4871 goto ReadStructEndError 4872 } 4873 4874 return nil 4875 ReadStructBeginError: 4876 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 4877 ReadFieldBeginError: 4878 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 4879 ReadFieldError: 4880 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Exception[fieldId]), err) 4881 SkipFieldError: 4882 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 4883 4884 ReadFieldEndError: 4885 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 4886 ReadStructEndError: 4887 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 4888 } 4889 4890 func (p *Exception) ReadField1(iprot thrift.TProtocol) error { 4891 if v, err := iprot.ReadI32(); err != nil { 4892 return err 4893 } else { 4894 p.Code = v 4895 } 4896 return nil 4897 } 4898 4899 func (p *Exception) ReadField255(iprot thrift.TProtocol) error { 4900 if v, err := iprot.ReadString(); err != nil { 4901 return err 4902 } else { 4903 p.Msg = v 4904 } 4905 return nil 4906 } 4907 4908 func (p *Exception) Write(oprot thrift.TProtocol) (err error) { 4909 var fieldId int16 4910 if err = oprot.WriteStructBegin("Exception"); err != nil { 4911 goto WriteStructBeginError 4912 } 4913 if p != nil { 4914 if err = p.writeField1(oprot); err != nil { 4915 fieldId = 1 4916 goto WriteFieldError 4917 } 4918 if err = p.writeField255(oprot); err != nil { 4919 fieldId = 255 4920 goto WriteFieldError 4921 } 4922 4923 } 4924 if err = oprot.WriteFieldStop(); err != nil { 4925 goto WriteFieldStopError 4926 } 4927 if err = oprot.WriteStructEnd(); err != nil { 4928 goto WriteStructEndError 4929 } 4930 return nil 4931 WriteStructBeginError: 4932 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 4933 WriteFieldError: 4934 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 4935 WriteFieldStopError: 4936 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 4937 WriteStructEndError: 4938 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 4939 } 4940 4941 func (p *Exception) writeField1(oprot thrift.TProtocol) (err error) { 4942 if err = oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { 4943 goto WriteFieldBeginError 4944 } 4945 if err := oprot.WriteI32(p.Code); err != nil { 4946 return err 4947 } 4948 if err = oprot.WriteFieldEnd(); err != nil { 4949 goto WriteFieldEndError 4950 } 4951 return nil 4952 WriteFieldBeginError: 4953 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 4954 WriteFieldEndError: 4955 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 4956 } 4957 4958 func (p *Exception) writeField255(oprot thrift.TProtocol) (err error) { 4959 if err = oprot.WriteFieldBegin("msg", thrift.STRING, 255); err != nil { 4960 goto WriteFieldBeginError 4961 } 4962 if err := oprot.WriteString(p.Msg); err != nil { 4963 return err 4964 } 4965 if err = oprot.WriteFieldEnd(); err != nil { 4966 goto WriteFieldEndError 4967 } 4968 return nil 4969 WriteFieldBeginError: 4970 return thrift.PrependError(fmt.Sprintf("%T write field 255 begin error: ", p), err) 4971 WriteFieldEndError: 4972 return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) 4973 } 4974 4975 func (p *Exception) String() string { 4976 if p == nil { 4977 return "<nil>" 4978 } 4979 return fmt.Sprintf("Exception(%+v)", *p) 4980 } 4981 func (p *Exception) Error() string { 4982 return p.String() 4983 } 4984 4985 func (p *Exception) DeepEqual(ano *Exception) bool { 4986 if p == ano { 4987 return true 4988 } else if p == nil || ano == nil { 4989 return false 4990 } 4991 if !p.Field1DeepEqual(ano.Code) { 4992 return false 4993 } 4994 if !p.Field255DeepEqual(ano.Msg) { 4995 return false 4996 } 4997 return true 4998 } 4999 5000 func (p *Exception) Field1DeepEqual(src int32) bool { 5001 5002 if p.Code != src { 5003 return false 5004 } 5005 return true 5006 } 5007 func (p *Exception) Field255DeepEqual(src string) bool { 5008 5009 if strings.Compare(p.Msg, src) != 0 { 5010 return false 5011 } 5012 return true 5013 } 5014 5015 type ExampleService interface { 5016 ExampleMethod(ctx context.Context, req *ExampleReq) (r *ExampleResp, err error) 5017 5018 ExamplePartialMethod(ctx context.Context, req *ExampleReqPartial) (r *A, err error) 5019 5020 ExampleSuperMethod(ctx context.Context, req *ExampleSuper) (r *A, err error) 5021 5022 Foo(ctx context.Context, req *A) (r *A, err error) 5023 5024 Ping(ctx context.Context, msg string) (r string, err error) 5025 5026 Oneway(ctx context.Context, msg string) (err error) 5027 5028 Void(ctx context.Context, msg string) (err error) 5029 } 5030 5031 type ExampleServiceClient struct { 5032 c thrift.TClient 5033 } 5034 5035 func NewExampleServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ExampleServiceClient { 5036 return &ExampleServiceClient{ 5037 c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), 5038 } 5039 } 5040 5041 func NewExampleServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ExampleServiceClient { 5042 return &ExampleServiceClient{ 5043 c: thrift.NewTStandardClient(iprot, oprot), 5044 } 5045 } 5046 5047 func NewExampleServiceClient(c thrift.TClient) *ExampleServiceClient { 5048 return &ExampleServiceClient{ 5049 c: c, 5050 } 5051 } 5052 5053 func (p *ExampleServiceClient) Client_() thrift.TClient { 5054 return p.c 5055 } 5056 5057 func (p *ExampleServiceClient) ExampleMethod(ctx context.Context, req *ExampleReq) (r *ExampleResp, err error) { 5058 var _args ExampleServiceExampleMethodArgs 5059 _args.Req = req 5060 var _result ExampleServiceExampleMethodResult 5061 if err = p.Client_().Call(ctx, "ExampleMethod", &_args, &_result); err != nil { 5062 return 5063 } 5064 switch { 5065 case _result.Err != nil: 5066 return r, _result.Err 5067 } 5068 return _result.GetSuccess(), nil 5069 } 5070 5071 func (p *ExampleServiceClient) ExamplePartialMethod(ctx context.Context, req *ExampleReqPartial) (r *A, err error) { 5072 var _args ExampleServiceExamplePartialMethodArgs 5073 _args.Req = req 5074 var _result ExampleServiceExamplePartialMethodResult 5075 if err = p.Client_().Call(ctx, "ExamplePartialMethod", &_args, &_result); err != nil { 5076 return 5077 } 5078 return _result.GetSuccess(), nil 5079 } 5080 5081 func (p *ExampleServiceClient) ExampleSuperMethod(ctx context.Context, req *ExampleSuper) (r *A, err error) { 5082 var _args ExampleServiceExampleSuperMethodArgs 5083 _args.Req = req 5084 var _result ExampleServiceExampleSuperMethodResult 5085 if err = p.Client_().Call(ctx, "ExampleSuperMethod", &_args, &_result); err != nil { 5086 return 5087 } 5088 return _result.GetSuccess(), nil 5089 } 5090 5091 func (p *ExampleServiceClient) Foo(ctx context.Context, req *A) (r *A, err error) { 5092 var _args ExampleServiceFooArgs 5093 _args.Req = req 5094 var _result ExampleServiceFooResult 5095 if err = p.Client_().Call(ctx, "Foo", &_args, &_result); err != nil { 5096 return 5097 } 5098 return _result.GetSuccess(), nil 5099 } 5100 5101 func (p *ExampleServiceClient) Ping(ctx context.Context, msg string) (r string, err error) { 5102 var _args ExampleServicePingArgs 5103 _args.Msg = msg 5104 var _result ExampleServicePingResult 5105 if err = p.Client_().Call(ctx, "Ping", &_args, &_result); err != nil { 5106 return 5107 } 5108 return _result.GetSuccess(), nil 5109 } 5110 5111 func (p *ExampleServiceClient) Oneway(ctx context.Context, msg string) (err error) { 5112 var _args ExampleServiceOnewayArgs 5113 _args.Msg = msg 5114 if err = p.Client_().Call(ctx, "Oneway", &_args, nil); err != nil { 5115 return 5116 } 5117 return nil 5118 } 5119 5120 func (p *ExampleServiceClient) Void(ctx context.Context, msg string) (err error) { 5121 var _args ExampleServiceVoidArgs 5122 _args.Msg = msg 5123 var _result ExampleServiceVoidResult 5124 if err = p.Client_().Call(ctx, "Void", &_args, &_result); err != nil { 5125 return 5126 } 5127 return nil 5128 } 5129 5130 type ExampleServiceProcessor struct { 5131 processorMap map[string]thrift.TProcessorFunction 5132 handler ExampleService 5133 } 5134 5135 func (p *ExampleServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { 5136 p.processorMap[key] = processor 5137 } 5138 5139 func (p *ExampleServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { 5140 processor, ok = p.processorMap[key] 5141 return processor, ok 5142 } 5143 5144 func (p *ExampleServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { 5145 return p.processorMap 5146 } 5147 5148 func NewExampleServiceProcessor(handler ExampleService) *ExampleServiceProcessor { 5149 self := &ExampleServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} 5150 self.AddToProcessorMap("ExampleMethod", &exampleServiceProcessorExampleMethod{handler: handler}) 5151 self.AddToProcessorMap("ExamplePartialMethod", &exampleServiceProcessorExamplePartialMethod{handler: handler}) 5152 self.AddToProcessorMap("ExampleSuperMethod", &exampleServiceProcessorExampleSuperMethod{handler: handler}) 5153 self.AddToProcessorMap("Foo", &exampleServiceProcessorFoo{handler: handler}) 5154 self.AddToProcessorMap("Ping", &exampleServiceProcessorPing{handler: handler}) 5155 self.AddToProcessorMap("Oneway", &exampleServiceProcessorOneway{handler: handler}) 5156 self.AddToProcessorMap("Void", &exampleServiceProcessorVoid{handler: handler}) 5157 return self 5158 } 5159 func (p *ExampleServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 5160 name, _, seqId, err := iprot.ReadMessageBegin() 5161 if err != nil { 5162 return false, err 5163 } 5164 if processor, ok := p.GetProcessorFunction(name); ok { 5165 return processor.Process(ctx, seqId, iprot, oprot) 5166 } 5167 iprot.Skip(thrift.STRUCT) 5168 iprot.ReadMessageEnd() 5169 x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) 5170 oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) 5171 x.Write(oprot) 5172 oprot.WriteMessageEnd() 5173 oprot.Flush(ctx) 5174 return false, x 5175 } 5176 5177 type exampleServiceProcessorExampleMethod struct { 5178 handler ExampleService 5179 } 5180 5181 func (p *exampleServiceProcessorExampleMethod) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 5182 args := ExampleServiceExampleMethodArgs{} 5183 if err = args.Read(iprot); err != nil { 5184 iprot.ReadMessageEnd() 5185 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 5186 oprot.WriteMessageBegin("ExampleMethod", thrift.EXCEPTION, seqId) 5187 x.Write(oprot) 5188 oprot.WriteMessageEnd() 5189 oprot.Flush(ctx) 5190 return false, err 5191 } 5192 5193 iprot.ReadMessageEnd() 5194 var err2 error 5195 result := ExampleServiceExampleMethodResult{} 5196 var retval *ExampleResp 5197 if retval, err2 = p.handler.ExampleMethod(ctx, args.Req); err2 != nil { 5198 switch v := err2.(type) { 5199 case *Exception: 5200 result.Err = v 5201 default: 5202 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExampleMethod: "+err2.Error()) 5203 oprot.WriteMessageBegin("ExampleMethod", thrift.EXCEPTION, seqId) 5204 x.Write(oprot) 5205 oprot.WriteMessageEnd() 5206 oprot.Flush(ctx) 5207 return true, err2 5208 } 5209 } else { 5210 result.Success = retval 5211 } 5212 if err2 = oprot.WriteMessageBegin("ExampleMethod", thrift.REPLY, seqId); err2 != nil { 5213 err = err2 5214 } 5215 if err2 = result.Write(oprot); err == nil && err2 != nil { 5216 err = err2 5217 } 5218 if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 5219 err = err2 5220 } 5221 if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 5222 err = err2 5223 } 5224 if err != nil { 5225 return 5226 } 5227 return true, err 5228 } 5229 5230 type exampleServiceProcessorExamplePartialMethod struct { 5231 handler ExampleService 5232 } 5233 5234 func (p *exampleServiceProcessorExamplePartialMethod) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 5235 args := ExampleServiceExamplePartialMethodArgs{} 5236 if err = args.Read(iprot); err != nil { 5237 iprot.ReadMessageEnd() 5238 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 5239 oprot.WriteMessageBegin("ExamplePartialMethod", thrift.EXCEPTION, seqId) 5240 x.Write(oprot) 5241 oprot.WriteMessageEnd() 5242 oprot.Flush(ctx) 5243 return false, err 5244 } 5245 5246 iprot.ReadMessageEnd() 5247 var err2 error 5248 result := ExampleServiceExamplePartialMethodResult{} 5249 var retval *A 5250 if retval, err2 = p.handler.ExamplePartialMethod(ctx, args.Req); err2 != nil { 5251 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExamplePartialMethod: "+err2.Error()) 5252 oprot.WriteMessageBegin("ExamplePartialMethod", thrift.EXCEPTION, seqId) 5253 x.Write(oprot) 5254 oprot.WriteMessageEnd() 5255 oprot.Flush(ctx) 5256 return true, err2 5257 } else { 5258 result.Success = retval 5259 } 5260 if err2 = oprot.WriteMessageBegin("ExamplePartialMethod", thrift.REPLY, seqId); err2 != nil { 5261 err = err2 5262 } 5263 if err2 = result.Write(oprot); err == nil && err2 != nil { 5264 err = err2 5265 } 5266 if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 5267 err = err2 5268 } 5269 if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 5270 err = err2 5271 } 5272 if err != nil { 5273 return 5274 } 5275 return true, err 5276 } 5277 5278 type exampleServiceProcessorExampleSuperMethod struct { 5279 handler ExampleService 5280 } 5281 5282 func (p *exampleServiceProcessorExampleSuperMethod) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 5283 args := ExampleServiceExampleSuperMethodArgs{} 5284 if err = args.Read(iprot); err != nil { 5285 iprot.ReadMessageEnd() 5286 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 5287 oprot.WriteMessageBegin("ExampleSuperMethod", thrift.EXCEPTION, seqId) 5288 x.Write(oprot) 5289 oprot.WriteMessageEnd() 5290 oprot.Flush(ctx) 5291 return false, err 5292 } 5293 5294 iprot.ReadMessageEnd() 5295 var err2 error 5296 result := ExampleServiceExampleSuperMethodResult{} 5297 var retval *A 5298 if retval, err2 = p.handler.ExampleSuperMethod(ctx, args.Req); err2 != nil { 5299 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExampleSuperMethod: "+err2.Error()) 5300 oprot.WriteMessageBegin("ExampleSuperMethod", thrift.EXCEPTION, seqId) 5301 x.Write(oprot) 5302 oprot.WriteMessageEnd() 5303 oprot.Flush(ctx) 5304 return true, err2 5305 } else { 5306 result.Success = retval 5307 } 5308 if err2 = oprot.WriteMessageBegin("ExampleSuperMethod", thrift.REPLY, seqId); err2 != nil { 5309 err = err2 5310 } 5311 if err2 = result.Write(oprot); err == nil && err2 != nil { 5312 err = err2 5313 } 5314 if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 5315 err = err2 5316 } 5317 if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 5318 err = err2 5319 } 5320 if err != nil { 5321 return 5322 } 5323 return true, err 5324 } 5325 5326 type exampleServiceProcessorFoo struct { 5327 handler ExampleService 5328 } 5329 5330 func (p *exampleServiceProcessorFoo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 5331 args := ExampleServiceFooArgs{} 5332 if err = args.Read(iprot); err != nil { 5333 iprot.ReadMessageEnd() 5334 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 5335 oprot.WriteMessageBegin("Foo", thrift.EXCEPTION, seqId) 5336 x.Write(oprot) 5337 oprot.WriteMessageEnd() 5338 oprot.Flush(ctx) 5339 return false, err 5340 } 5341 5342 iprot.ReadMessageEnd() 5343 var err2 error 5344 result := ExampleServiceFooResult{} 5345 var retval *A 5346 if retval, err2 = p.handler.Foo(ctx, args.Req); err2 != nil { 5347 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Foo: "+err2.Error()) 5348 oprot.WriteMessageBegin("Foo", thrift.EXCEPTION, seqId) 5349 x.Write(oprot) 5350 oprot.WriteMessageEnd() 5351 oprot.Flush(ctx) 5352 return true, err2 5353 } else { 5354 result.Success = retval 5355 } 5356 if err2 = oprot.WriteMessageBegin("Foo", thrift.REPLY, seqId); err2 != nil { 5357 err = err2 5358 } 5359 if err2 = result.Write(oprot); err == nil && err2 != nil { 5360 err = err2 5361 } 5362 if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 5363 err = err2 5364 } 5365 if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 5366 err = err2 5367 } 5368 if err != nil { 5369 return 5370 } 5371 return true, err 5372 } 5373 5374 type exampleServiceProcessorPing struct { 5375 handler ExampleService 5376 } 5377 5378 func (p *exampleServiceProcessorPing) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 5379 args := ExampleServicePingArgs{} 5380 if err = args.Read(iprot); err != nil { 5381 iprot.ReadMessageEnd() 5382 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 5383 oprot.WriteMessageBegin("Ping", thrift.EXCEPTION, seqId) 5384 x.Write(oprot) 5385 oprot.WriteMessageEnd() 5386 oprot.Flush(ctx) 5387 return false, err 5388 } 5389 5390 iprot.ReadMessageEnd() 5391 var err2 error 5392 result := ExampleServicePingResult{} 5393 var retval string 5394 if retval, err2 = p.handler.Ping(ctx, args.Msg); err2 != nil { 5395 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Ping: "+err2.Error()) 5396 oprot.WriteMessageBegin("Ping", thrift.EXCEPTION, seqId) 5397 x.Write(oprot) 5398 oprot.WriteMessageEnd() 5399 oprot.Flush(ctx) 5400 return true, err2 5401 } else { 5402 result.Success = &retval 5403 } 5404 if err2 = oprot.WriteMessageBegin("Ping", thrift.REPLY, seqId); err2 != nil { 5405 err = err2 5406 } 5407 if err2 = result.Write(oprot); err == nil && err2 != nil { 5408 err = err2 5409 } 5410 if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 5411 err = err2 5412 } 5413 if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 5414 err = err2 5415 } 5416 if err != nil { 5417 return 5418 } 5419 return true, err 5420 } 5421 5422 type exampleServiceProcessorOneway struct { 5423 handler ExampleService 5424 } 5425 5426 func (p *exampleServiceProcessorOneway) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 5427 args := ExampleServiceOnewayArgs{} 5428 if err = args.Read(iprot); err != nil { 5429 iprot.ReadMessageEnd() 5430 return false, err 5431 } 5432 5433 iprot.ReadMessageEnd() 5434 var err2 error 5435 if err2 = p.handler.Oneway(ctx, args.Msg); err2 != nil { 5436 return true, err2 5437 } 5438 return true, nil 5439 } 5440 5441 type exampleServiceProcessorVoid struct { 5442 handler ExampleService 5443 } 5444 5445 func (p *exampleServiceProcessorVoid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { 5446 args := ExampleServiceVoidArgs{} 5447 if err = args.Read(iprot); err != nil { 5448 iprot.ReadMessageEnd() 5449 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) 5450 oprot.WriteMessageBegin("Void", thrift.EXCEPTION, seqId) 5451 x.Write(oprot) 5452 oprot.WriteMessageEnd() 5453 oprot.Flush(ctx) 5454 return false, err 5455 } 5456 5457 iprot.ReadMessageEnd() 5458 var err2 error 5459 result := ExampleServiceVoidResult{} 5460 if err2 = p.handler.Void(ctx, args.Msg); err2 != nil { 5461 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Void: "+err2.Error()) 5462 oprot.WriteMessageBegin("Void", thrift.EXCEPTION, seqId) 5463 x.Write(oprot) 5464 oprot.WriteMessageEnd() 5465 oprot.Flush(ctx) 5466 return true, err2 5467 } 5468 if err2 = oprot.WriteMessageBegin("Void", thrift.REPLY, seqId); err2 != nil { 5469 err = err2 5470 } 5471 if err2 = result.Write(oprot); err == nil && err2 != nil { 5472 err = err2 5473 } 5474 if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { 5475 err = err2 5476 } 5477 if err2 = oprot.Flush(ctx); err == nil && err2 != nil { 5478 err = err2 5479 } 5480 if err != nil { 5481 return 5482 } 5483 return true, err 5484 } 5485 5486 type ExampleServiceExampleMethodArgs struct { 5487 Req *ExampleReq `thrift:"req,1" json:"req"` 5488 } 5489 5490 func NewExampleServiceExampleMethodArgs() *ExampleServiceExampleMethodArgs { 5491 return &ExampleServiceExampleMethodArgs{} 5492 } 5493 5494 var ExampleServiceExampleMethodArgs_Req_DEFAULT *ExampleReq 5495 5496 func (p *ExampleServiceExampleMethodArgs) GetReq() (v *ExampleReq) { 5497 if !p.IsSetReq() { 5498 return ExampleServiceExampleMethodArgs_Req_DEFAULT 5499 } 5500 return p.Req 5501 } 5502 func (p *ExampleServiceExampleMethodArgs) SetReq(val *ExampleReq) { 5503 p.Req = val 5504 } 5505 5506 var fieldIDToName_ExampleServiceExampleMethodArgs = map[int16]string{ 5507 1: "req", 5508 } 5509 5510 func (p *ExampleServiceExampleMethodArgs) IsSetReq() bool { 5511 return p.Req != nil 5512 } 5513 5514 func (p *ExampleServiceExampleMethodArgs) Read(iprot thrift.TProtocol) (err error) { 5515 5516 var fieldTypeId thrift.TType 5517 var fieldId int16 5518 5519 if _, err = iprot.ReadStructBegin(); err != nil { 5520 goto ReadStructBeginError 5521 } 5522 5523 for { 5524 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 5525 if err != nil { 5526 goto ReadFieldBeginError 5527 } 5528 if fieldTypeId == thrift.STOP { 5529 break 5530 } 5531 5532 switch fieldId { 5533 case 1: 5534 if fieldTypeId == thrift.STRUCT { 5535 if err = p.ReadField1(iprot); err != nil { 5536 goto ReadFieldError 5537 } 5538 } else { 5539 if err = iprot.Skip(fieldTypeId); err != nil { 5540 goto SkipFieldError 5541 } 5542 } 5543 default: 5544 if err = iprot.Skip(fieldTypeId); err != nil { 5545 goto SkipFieldError 5546 } 5547 } 5548 5549 if err = iprot.ReadFieldEnd(); err != nil { 5550 goto ReadFieldEndError 5551 } 5552 } 5553 if err = iprot.ReadStructEnd(); err != nil { 5554 goto ReadStructEndError 5555 } 5556 5557 return nil 5558 ReadStructBeginError: 5559 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 5560 ReadFieldBeginError: 5561 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 5562 ReadFieldError: 5563 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceExampleMethodArgs[fieldId]), err) 5564 SkipFieldError: 5565 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 5566 5567 ReadFieldEndError: 5568 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 5569 ReadStructEndError: 5570 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 5571 } 5572 5573 func (p *ExampleServiceExampleMethodArgs) ReadField1(iprot thrift.TProtocol) error { 5574 p.Req = NewExampleReq() 5575 if err := p.Req.Read(iprot); err != nil { 5576 return err 5577 } 5578 return nil 5579 } 5580 5581 func (p *ExampleServiceExampleMethodArgs) Write(oprot thrift.TProtocol) (err error) { 5582 var fieldId int16 5583 if err = oprot.WriteStructBegin("ExampleMethod_args"); err != nil { 5584 goto WriteStructBeginError 5585 } 5586 if p != nil { 5587 if err = p.writeField1(oprot); err != nil { 5588 fieldId = 1 5589 goto WriteFieldError 5590 } 5591 5592 } 5593 if err = oprot.WriteFieldStop(); err != nil { 5594 goto WriteFieldStopError 5595 } 5596 if err = oprot.WriteStructEnd(); err != nil { 5597 goto WriteStructEndError 5598 } 5599 return nil 5600 WriteStructBeginError: 5601 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 5602 WriteFieldError: 5603 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 5604 WriteFieldStopError: 5605 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 5606 WriteStructEndError: 5607 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 5608 } 5609 5610 func (p *ExampleServiceExampleMethodArgs) writeField1(oprot thrift.TProtocol) (err error) { 5611 if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { 5612 goto WriteFieldBeginError 5613 } 5614 if err := p.Req.Write(oprot); err != nil { 5615 return err 5616 } 5617 if err = oprot.WriteFieldEnd(); err != nil { 5618 goto WriteFieldEndError 5619 } 5620 return nil 5621 WriteFieldBeginError: 5622 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 5623 WriteFieldEndError: 5624 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 5625 } 5626 5627 func (p *ExampleServiceExampleMethodArgs) String() string { 5628 if p == nil { 5629 return "<nil>" 5630 } 5631 return fmt.Sprintf("ExampleServiceExampleMethodArgs(%+v)", *p) 5632 } 5633 5634 func (p *ExampleServiceExampleMethodArgs) DeepEqual(ano *ExampleServiceExampleMethodArgs) bool { 5635 if p == ano { 5636 return true 5637 } else if p == nil || ano == nil { 5638 return false 5639 } 5640 if !p.Field1DeepEqual(ano.Req) { 5641 return false 5642 } 5643 return true 5644 } 5645 5646 func (p *ExampleServiceExampleMethodArgs) Field1DeepEqual(src *ExampleReq) bool { 5647 5648 if !p.Req.DeepEqual(src) { 5649 return false 5650 } 5651 return true 5652 } 5653 5654 type ExampleServiceExampleMethodResult struct { 5655 Success *ExampleResp `thrift:"success,0" json:"success,omitempty"` 5656 Err *Exception `thrift:"err,1" json:"err,omitempty"` 5657 } 5658 5659 func NewExampleServiceExampleMethodResult() *ExampleServiceExampleMethodResult { 5660 return &ExampleServiceExampleMethodResult{} 5661 } 5662 5663 var ExampleServiceExampleMethodResult_Success_DEFAULT *ExampleResp 5664 5665 func (p *ExampleServiceExampleMethodResult) GetSuccess() (v *ExampleResp) { 5666 if !p.IsSetSuccess() { 5667 return ExampleServiceExampleMethodResult_Success_DEFAULT 5668 } 5669 return p.Success 5670 } 5671 5672 var ExampleServiceExampleMethodResult_Err_DEFAULT *Exception 5673 5674 func (p *ExampleServiceExampleMethodResult) GetErr() (v *Exception) { 5675 if !p.IsSetErr() { 5676 return ExampleServiceExampleMethodResult_Err_DEFAULT 5677 } 5678 return p.Err 5679 } 5680 func (p *ExampleServiceExampleMethodResult) SetSuccess(x interface{}) { 5681 p.Success = x.(*ExampleResp) 5682 } 5683 func (p *ExampleServiceExampleMethodResult) SetErr(val *Exception) { 5684 p.Err = val 5685 } 5686 5687 var fieldIDToName_ExampleServiceExampleMethodResult = map[int16]string{ 5688 0: "success", 5689 1: "err", 5690 } 5691 5692 func (p *ExampleServiceExampleMethodResult) IsSetSuccess() bool { 5693 return p.Success != nil 5694 } 5695 5696 func (p *ExampleServiceExampleMethodResult) IsSetErr() bool { 5697 return p.Err != nil 5698 } 5699 5700 func (p *ExampleServiceExampleMethodResult) Read(iprot thrift.TProtocol) (err error) { 5701 5702 var fieldTypeId thrift.TType 5703 var fieldId int16 5704 5705 if _, err = iprot.ReadStructBegin(); err != nil { 5706 goto ReadStructBeginError 5707 } 5708 5709 for { 5710 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 5711 if err != nil { 5712 goto ReadFieldBeginError 5713 } 5714 if fieldTypeId == thrift.STOP { 5715 break 5716 } 5717 5718 switch fieldId { 5719 case 0: 5720 if fieldTypeId == thrift.STRUCT { 5721 if err = p.ReadField0(iprot); err != nil { 5722 goto ReadFieldError 5723 } 5724 } else { 5725 if err = iprot.Skip(fieldTypeId); err != nil { 5726 goto SkipFieldError 5727 } 5728 } 5729 case 1: 5730 if fieldTypeId == thrift.STRUCT { 5731 if err = p.ReadField1(iprot); err != nil { 5732 goto ReadFieldError 5733 } 5734 } else { 5735 if err = iprot.Skip(fieldTypeId); err != nil { 5736 goto SkipFieldError 5737 } 5738 } 5739 default: 5740 if err = iprot.Skip(fieldTypeId); err != nil { 5741 goto SkipFieldError 5742 } 5743 } 5744 5745 if err = iprot.ReadFieldEnd(); err != nil { 5746 goto ReadFieldEndError 5747 } 5748 } 5749 if err = iprot.ReadStructEnd(); err != nil { 5750 goto ReadStructEndError 5751 } 5752 5753 return nil 5754 ReadStructBeginError: 5755 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 5756 ReadFieldBeginError: 5757 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 5758 ReadFieldError: 5759 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceExampleMethodResult[fieldId]), err) 5760 SkipFieldError: 5761 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 5762 5763 ReadFieldEndError: 5764 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 5765 ReadStructEndError: 5766 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 5767 } 5768 5769 func (p *ExampleServiceExampleMethodResult) ReadField0(iprot thrift.TProtocol) error { 5770 p.Success = NewExampleResp() 5771 if err := p.Success.Read(iprot); err != nil { 5772 return err 5773 } 5774 return nil 5775 } 5776 5777 func (p *ExampleServiceExampleMethodResult) ReadField1(iprot thrift.TProtocol) error { 5778 p.Err = NewException() 5779 if err := p.Err.Read(iprot); err != nil { 5780 return err 5781 } 5782 return nil 5783 } 5784 5785 func (p *ExampleServiceExampleMethodResult) Write(oprot thrift.TProtocol) (err error) { 5786 var fieldId int16 5787 if err = oprot.WriteStructBegin("ExampleMethod_result"); err != nil { 5788 goto WriteStructBeginError 5789 } 5790 if p != nil { 5791 if err = p.writeField0(oprot); err != nil { 5792 fieldId = 0 5793 goto WriteFieldError 5794 } 5795 if err = p.writeField1(oprot); err != nil { 5796 fieldId = 1 5797 goto WriteFieldError 5798 } 5799 5800 } 5801 if err = oprot.WriteFieldStop(); err != nil { 5802 goto WriteFieldStopError 5803 } 5804 if err = oprot.WriteStructEnd(); err != nil { 5805 goto WriteStructEndError 5806 } 5807 return nil 5808 WriteStructBeginError: 5809 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 5810 WriteFieldError: 5811 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 5812 WriteFieldStopError: 5813 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 5814 WriteStructEndError: 5815 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 5816 } 5817 5818 func (p *ExampleServiceExampleMethodResult) writeField0(oprot thrift.TProtocol) (err error) { 5819 if p.IsSetSuccess() { 5820 if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 5821 goto WriteFieldBeginError 5822 } 5823 if err := p.Success.Write(oprot); err != nil { 5824 return err 5825 } 5826 if err = oprot.WriteFieldEnd(); err != nil { 5827 goto WriteFieldEndError 5828 } 5829 } 5830 return nil 5831 WriteFieldBeginError: 5832 return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) 5833 WriteFieldEndError: 5834 return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) 5835 } 5836 5837 func (p *ExampleServiceExampleMethodResult) writeField1(oprot thrift.TProtocol) (err error) { 5838 if p.IsSetErr() { 5839 if err = oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { 5840 goto WriteFieldBeginError 5841 } 5842 if err := p.Err.Write(oprot); err != nil { 5843 return err 5844 } 5845 if err = oprot.WriteFieldEnd(); err != nil { 5846 goto WriteFieldEndError 5847 } 5848 } 5849 return nil 5850 WriteFieldBeginError: 5851 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 5852 WriteFieldEndError: 5853 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 5854 } 5855 5856 func (p *ExampleServiceExampleMethodResult) String() string { 5857 if p == nil { 5858 return "<nil>" 5859 } 5860 return fmt.Sprintf("ExampleServiceExampleMethodResult(%+v)", *p) 5861 } 5862 5863 func (p *ExampleServiceExampleMethodResult) DeepEqual(ano *ExampleServiceExampleMethodResult) bool { 5864 if p == ano { 5865 return true 5866 } else if p == nil || ano == nil { 5867 return false 5868 } 5869 if !p.Field0DeepEqual(ano.Success) { 5870 return false 5871 } 5872 if !p.Field1DeepEqual(ano.Err) { 5873 return false 5874 } 5875 return true 5876 } 5877 5878 func (p *ExampleServiceExampleMethodResult) Field0DeepEqual(src *ExampleResp) bool { 5879 5880 if !p.Success.DeepEqual(src) { 5881 return false 5882 } 5883 return true 5884 } 5885 func (p *ExampleServiceExampleMethodResult) Field1DeepEqual(src *Exception) bool { 5886 5887 if !p.Err.DeepEqual(src) { 5888 return false 5889 } 5890 return true 5891 } 5892 5893 type ExampleServiceExamplePartialMethodArgs struct { 5894 Req *ExampleReqPartial `thrift:"req,1" json:"req"` 5895 } 5896 5897 func NewExampleServiceExamplePartialMethodArgs() *ExampleServiceExamplePartialMethodArgs { 5898 return &ExampleServiceExamplePartialMethodArgs{} 5899 } 5900 5901 var ExampleServiceExamplePartialMethodArgs_Req_DEFAULT *ExampleReqPartial 5902 5903 func (p *ExampleServiceExamplePartialMethodArgs) GetReq() (v *ExampleReqPartial) { 5904 if !p.IsSetReq() { 5905 return ExampleServiceExamplePartialMethodArgs_Req_DEFAULT 5906 } 5907 return p.Req 5908 } 5909 func (p *ExampleServiceExamplePartialMethodArgs) SetReq(val *ExampleReqPartial) { 5910 p.Req = val 5911 } 5912 5913 var fieldIDToName_ExampleServiceExamplePartialMethodArgs = map[int16]string{ 5914 1: "req", 5915 } 5916 5917 func (p *ExampleServiceExamplePartialMethodArgs) IsSetReq() bool { 5918 return p.Req != nil 5919 } 5920 5921 func (p *ExampleServiceExamplePartialMethodArgs) Read(iprot thrift.TProtocol) (err error) { 5922 5923 var fieldTypeId thrift.TType 5924 var fieldId int16 5925 5926 if _, err = iprot.ReadStructBegin(); err != nil { 5927 goto ReadStructBeginError 5928 } 5929 5930 for { 5931 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 5932 if err != nil { 5933 goto ReadFieldBeginError 5934 } 5935 if fieldTypeId == thrift.STOP { 5936 break 5937 } 5938 5939 switch fieldId { 5940 case 1: 5941 if fieldTypeId == thrift.STRUCT { 5942 if err = p.ReadField1(iprot); err != nil { 5943 goto ReadFieldError 5944 } 5945 } else { 5946 if err = iprot.Skip(fieldTypeId); err != nil { 5947 goto SkipFieldError 5948 } 5949 } 5950 default: 5951 if err = iprot.Skip(fieldTypeId); err != nil { 5952 goto SkipFieldError 5953 } 5954 } 5955 5956 if err = iprot.ReadFieldEnd(); err != nil { 5957 goto ReadFieldEndError 5958 } 5959 } 5960 if err = iprot.ReadStructEnd(); err != nil { 5961 goto ReadStructEndError 5962 } 5963 5964 return nil 5965 ReadStructBeginError: 5966 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 5967 ReadFieldBeginError: 5968 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 5969 ReadFieldError: 5970 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceExamplePartialMethodArgs[fieldId]), err) 5971 SkipFieldError: 5972 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 5973 5974 ReadFieldEndError: 5975 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 5976 ReadStructEndError: 5977 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 5978 } 5979 5980 func (p *ExampleServiceExamplePartialMethodArgs) ReadField1(iprot thrift.TProtocol) error { 5981 p.Req = NewExampleReqPartial() 5982 if err := p.Req.Read(iprot); err != nil { 5983 return err 5984 } 5985 return nil 5986 } 5987 5988 func (p *ExampleServiceExamplePartialMethodArgs) Write(oprot thrift.TProtocol) (err error) { 5989 var fieldId int16 5990 if err = oprot.WriteStructBegin("ExamplePartialMethod_args"); err != nil { 5991 goto WriteStructBeginError 5992 } 5993 if p != nil { 5994 if err = p.writeField1(oprot); err != nil { 5995 fieldId = 1 5996 goto WriteFieldError 5997 } 5998 5999 } 6000 if err = oprot.WriteFieldStop(); err != nil { 6001 goto WriteFieldStopError 6002 } 6003 if err = oprot.WriteStructEnd(); err != nil { 6004 goto WriteStructEndError 6005 } 6006 return nil 6007 WriteStructBeginError: 6008 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 6009 WriteFieldError: 6010 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 6011 WriteFieldStopError: 6012 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 6013 WriteStructEndError: 6014 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 6015 } 6016 6017 func (p *ExampleServiceExamplePartialMethodArgs) writeField1(oprot thrift.TProtocol) (err error) { 6018 if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { 6019 goto WriteFieldBeginError 6020 } 6021 if err := p.Req.Write(oprot); err != nil { 6022 return err 6023 } 6024 if err = oprot.WriteFieldEnd(); err != nil { 6025 goto WriteFieldEndError 6026 } 6027 return nil 6028 WriteFieldBeginError: 6029 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 6030 WriteFieldEndError: 6031 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 6032 } 6033 6034 func (p *ExampleServiceExamplePartialMethodArgs) String() string { 6035 if p == nil { 6036 return "<nil>" 6037 } 6038 return fmt.Sprintf("ExampleServiceExamplePartialMethodArgs(%+v)", *p) 6039 } 6040 6041 func (p *ExampleServiceExamplePartialMethodArgs) DeepEqual(ano *ExampleServiceExamplePartialMethodArgs) bool { 6042 if p == ano { 6043 return true 6044 } else if p == nil || ano == nil { 6045 return false 6046 } 6047 if !p.Field1DeepEqual(ano.Req) { 6048 return false 6049 } 6050 return true 6051 } 6052 6053 func (p *ExampleServiceExamplePartialMethodArgs) Field1DeepEqual(src *ExampleReqPartial) bool { 6054 6055 if !p.Req.DeepEqual(src) { 6056 return false 6057 } 6058 return true 6059 } 6060 6061 type ExampleServiceExamplePartialMethodResult struct { 6062 Success *A `thrift:"success,0" json:"success,omitempty"` 6063 } 6064 6065 func NewExampleServiceExamplePartialMethodResult() *ExampleServiceExamplePartialMethodResult { 6066 return &ExampleServiceExamplePartialMethodResult{} 6067 } 6068 6069 var ExampleServiceExamplePartialMethodResult_Success_DEFAULT *A 6070 6071 func (p *ExampleServiceExamplePartialMethodResult) GetSuccess() (v *A) { 6072 if !p.IsSetSuccess() { 6073 return ExampleServiceExamplePartialMethodResult_Success_DEFAULT 6074 } 6075 return p.Success 6076 } 6077 func (p *ExampleServiceExamplePartialMethodResult) SetSuccess(x interface{}) { 6078 p.Success = x.(*A) 6079 } 6080 6081 var fieldIDToName_ExampleServiceExamplePartialMethodResult = map[int16]string{ 6082 0: "success", 6083 } 6084 6085 func (p *ExampleServiceExamplePartialMethodResult) IsSetSuccess() bool { 6086 return p.Success != nil 6087 } 6088 6089 func (p *ExampleServiceExamplePartialMethodResult) Read(iprot thrift.TProtocol) (err error) { 6090 6091 var fieldTypeId thrift.TType 6092 var fieldId int16 6093 6094 if _, err = iprot.ReadStructBegin(); err != nil { 6095 goto ReadStructBeginError 6096 } 6097 6098 for { 6099 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 6100 if err != nil { 6101 goto ReadFieldBeginError 6102 } 6103 if fieldTypeId == thrift.STOP { 6104 break 6105 } 6106 6107 switch fieldId { 6108 case 0: 6109 if fieldTypeId == thrift.STRUCT { 6110 if err = p.ReadField0(iprot); err != nil { 6111 goto ReadFieldError 6112 } 6113 } else { 6114 if err = iprot.Skip(fieldTypeId); err != nil { 6115 goto SkipFieldError 6116 } 6117 } 6118 default: 6119 if err = iprot.Skip(fieldTypeId); err != nil { 6120 goto SkipFieldError 6121 } 6122 } 6123 6124 if err = iprot.ReadFieldEnd(); err != nil { 6125 goto ReadFieldEndError 6126 } 6127 } 6128 if err = iprot.ReadStructEnd(); err != nil { 6129 goto ReadStructEndError 6130 } 6131 6132 return nil 6133 ReadStructBeginError: 6134 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 6135 ReadFieldBeginError: 6136 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 6137 ReadFieldError: 6138 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceExamplePartialMethodResult[fieldId]), err) 6139 SkipFieldError: 6140 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 6141 6142 ReadFieldEndError: 6143 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 6144 ReadStructEndError: 6145 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 6146 } 6147 6148 func (p *ExampleServiceExamplePartialMethodResult) ReadField0(iprot thrift.TProtocol) error { 6149 p.Success = NewA() 6150 if err := p.Success.Read(iprot); err != nil { 6151 return err 6152 } 6153 return nil 6154 } 6155 6156 func (p *ExampleServiceExamplePartialMethodResult) Write(oprot thrift.TProtocol) (err error) { 6157 var fieldId int16 6158 if err = oprot.WriteStructBegin("ExamplePartialMethod_result"); err != nil { 6159 goto WriteStructBeginError 6160 } 6161 if p != nil { 6162 if err = p.writeField0(oprot); err != nil { 6163 fieldId = 0 6164 goto WriteFieldError 6165 } 6166 6167 } 6168 if err = oprot.WriteFieldStop(); err != nil { 6169 goto WriteFieldStopError 6170 } 6171 if err = oprot.WriteStructEnd(); err != nil { 6172 goto WriteStructEndError 6173 } 6174 return nil 6175 WriteStructBeginError: 6176 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 6177 WriteFieldError: 6178 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 6179 WriteFieldStopError: 6180 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 6181 WriteStructEndError: 6182 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 6183 } 6184 6185 func (p *ExampleServiceExamplePartialMethodResult) writeField0(oprot thrift.TProtocol) (err error) { 6186 if p.IsSetSuccess() { 6187 if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 6188 goto WriteFieldBeginError 6189 } 6190 if err := p.Success.Write(oprot); err != nil { 6191 return err 6192 } 6193 if err = oprot.WriteFieldEnd(); err != nil { 6194 goto WriteFieldEndError 6195 } 6196 } 6197 return nil 6198 WriteFieldBeginError: 6199 return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) 6200 WriteFieldEndError: 6201 return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) 6202 } 6203 6204 func (p *ExampleServiceExamplePartialMethodResult) String() string { 6205 if p == nil { 6206 return "<nil>" 6207 } 6208 return fmt.Sprintf("ExampleServiceExamplePartialMethodResult(%+v)", *p) 6209 } 6210 6211 func (p *ExampleServiceExamplePartialMethodResult) DeepEqual(ano *ExampleServiceExamplePartialMethodResult) bool { 6212 if p == ano { 6213 return true 6214 } else if p == nil || ano == nil { 6215 return false 6216 } 6217 if !p.Field0DeepEqual(ano.Success) { 6218 return false 6219 } 6220 return true 6221 } 6222 6223 func (p *ExampleServiceExamplePartialMethodResult) Field0DeepEqual(src *A) bool { 6224 6225 if !p.Success.DeepEqual(src) { 6226 return false 6227 } 6228 return true 6229 } 6230 6231 type ExampleServiceExampleSuperMethodArgs struct { 6232 Req *ExampleSuper `thrift:"req,1" json:"req"` 6233 } 6234 6235 func NewExampleServiceExampleSuperMethodArgs() *ExampleServiceExampleSuperMethodArgs { 6236 return &ExampleServiceExampleSuperMethodArgs{} 6237 } 6238 6239 var ExampleServiceExampleSuperMethodArgs_Req_DEFAULT *ExampleSuper 6240 6241 func (p *ExampleServiceExampleSuperMethodArgs) GetReq() (v *ExampleSuper) { 6242 if !p.IsSetReq() { 6243 return ExampleServiceExampleSuperMethodArgs_Req_DEFAULT 6244 } 6245 return p.Req 6246 } 6247 func (p *ExampleServiceExampleSuperMethodArgs) SetReq(val *ExampleSuper) { 6248 p.Req = val 6249 } 6250 6251 var fieldIDToName_ExampleServiceExampleSuperMethodArgs = map[int16]string{ 6252 1: "req", 6253 } 6254 6255 func (p *ExampleServiceExampleSuperMethodArgs) IsSetReq() bool { 6256 return p.Req != nil 6257 } 6258 6259 func (p *ExampleServiceExampleSuperMethodArgs) Read(iprot thrift.TProtocol) (err error) { 6260 6261 var fieldTypeId thrift.TType 6262 var fieldId int16 6263 6264 if _, err = iprot.ReadStructBegin(); err != nil { 6265 goto ReadStructBeginError 6266 } 6267 6268 for { 6269 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 6270 if err != nil { 6271 goto ReadFieldBeginError 6272 } 6273 if fieldTypeId == thrift.STOP { 6274 break 6275 } 6276 6277 switch fieldId { 6278 case 1: 6279 if fieldTypeId == thrift.STRUCT { 6280 if err = p.ReadField1(iprot); err != nil { 6281 goto ReadFieldError 6282 } 6283 } else { 6284 if err = iprot.Skip(fieldTypeId); err != nil { 6285 goto SkipFieldError 6286 } 6287 } 6288 default: 6289 if err = iprot.Skip(fieldTypeId); err != nil { 6290 goto SkipFieldError 6291 } 6292 } 6293 6294 if err = iprot.ReadFieldEnd(); err != nil { 6295 goto ReadFieldEndError 6296 } 6297 } 6298 if err = iprot.ReadStructEnd(); err != nil { 6299 goto ReadStructEndError 6300 } 6301 6302 return nil 6303 ReadStructBeginError: 6304 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 6305 ReadFieldBeginError: 6306 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 6307 ReadFieldError: 6308 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceExampleSuperMethodArgs[fieldId]), err) 6309 SkipFieldError: 6310 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 6311 6312 ReadFieldEndError: 6313 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 6314 ReadStructEndError: 6315 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 6316 } 6317 6318 func (p *ExampleServiceExampleSuperMethodArgs) ReadField1(iprot thrift.TProtocol) error { 6319 p.Req = NewExampleSuper() 6320 if err := p.Req.Read(iprot); err != nil { 6321 return err 6322 } 6323 return nil 6324 } 6325 6326 func (p *ExampleServiceExampleSuperMethodArgs) Write(oprot thrift.TProtocol) (err error) { 6327 var fieldId int16 6328 if err = oprot.WriteStructBegin("ExampleSuperMethod_args"); err != nil { 6329 goto WriteStructBeginError 6330 } 6331 if p != nil { 6332 if err = p.writeField1(oprot); err != nil { 6333 fieldId = 1 6334 goto WriteFieldError 6335 } 6336 6337 } 6338 if err = oprot.WriteFieldStop(); err != nil { 6339 goto WriteFieldStopError 6340 } 6341 if err = oprot.WriteStructEnd(); err != nil { 6342 goto WriteStructEndError 6343 } 6344 return nil 6345 WriteStructBeginError: 6346 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 6347 WriteFieldError: 6348 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 6349 WriteFieldStopError: 6350 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 6351 WriteStructEndError: 6352 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 6353 } 6354 6355 func (p *ExampleServiceExampleSuperMethodArgs) writeField1(oprot thrift.TProtocol) (err error) { 6356 if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { 6357 goto WriteFieldBeginError 6358 } 6359 if err := p.Req.Write(oprot); err != nil { 6360 return err 6361 } 6362 if err = oprot.WriteFieldEnd(); err != nil { 6363 goto WriteFieldEndError 6364 } 6365 return nil 6366 WriteFieldBeginError: 6367 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 6368 WriteFieldEndError: 6369 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 6370 } 6371 6372 func (p *ExampleServiceExampleSuperMethodArgs) String() string { 6373 if p == nil { 6374 return "<nil>" 6375 } 6376 return fmt.Sprintf("ExampleServiceExampleSuperMethodArgs(%+v)", *p) 6377 } 6378 6379 func (p *ExampleServiceExampleSuperMethodArgs) DeepEqual(ano *ExampleServiceExampleSuperMethodArgs) bool { 6380 if p == ano { 6381 return true 6382 } else if p == nil || ano == nil { 6383 return false 6384 } 6385 if !p.Field1DeepEqual(ano.Req) { 6386 return false 6387 } 6388 return true 6389 } 6390 6391 func (p *ExampleServiceExampleSuperMethodArgs) Field1DeepEqual(src *ExampleSuper) bool { 6392 6393 if !p.Req.DeepEqual(src) { 6394 return false 6395 } 6396 return true 6397 } 6398 6399 type ExampleServiceExampleSuperMethodResult struct { 6400 Success *A `thrift:"success,0" json:"success,omitempty"` 6401 } 6402 6403 func NewExampleServiceExampleSuperMethodResult() *ExampleServiceExampleSuperMethodResult { 6404 return &ExampleServiceExampleSuperMethodResult{} 6405 } 6406 6407 var ExampleServiceExampleSuperMethodResult_Success_DEFAULT *A 6408 6409 func (p *ExampleServiceExampleSuperMethodResult) GetSuccess() (v *A) { 6410 if !p.IsSetSuccess() { 6411 return ExampleServiceExampleSuperMethodResult_Success_DEFAULT 6412 } 6413 return p.Success 6414 } 6415 func (p *ExampleServiceExampleSuperMethodResult) SetSuccess(x interface{}) { 6416 p.Success = x.(*A) 6417 } 6418 6419 var fieldIDToName_ExampleServiceExampleSuperMethodResult = map[int16]string{ 6420 0: "success", 6421 } 6422 6423 func (p *ExampleServiceExampleSuperMethodResult) IsSetSuccess() bool { 6424 return p.Success != nil 6425 } 6426 6427 func (p *ExampleServiceExampleSuperMethodResult) Read(iprot thrift.TProtocol) (err error) { 6428 6429 var fieldTypeId thrift.TType 6430 var fieldId int16 6431 6432 if _, err = iprot.ReadStructBegin(); err != nil { 6433 goto ReadStructBeginError 6434 } 6435 6436 for { 6437 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 6438 if err != nil { 6439 goto ReadFieldBeginError 6440 } 6441 if fieldTypeId == thrift.STOP { 6442 break 6443 } 6444 6445 switch fieldId { 6446 case 0: 6447 if fieldTypeId == thrift.STRUCT { 6448 if err = p.ReadField0(iprot); err != nil { 6449 goto ReadFieldError 6450 } 6451 } else { 6452 if err = iprot.Skip(fieldTypeId); err != nil { 6453 goto SkipFieldError 6454 } 6455 } 6456 default: 6457 if err = iprot.Skip(fieldTypeId); err != nil { 6458 goto SkipFieldError 6459 } 6460 } 6461 6462 if err = iprot.ReadFieldEnd(); err != nil { 6463 goto ReadFieldEndError 6464 } 6465 } 6466 if err = iprot.ReadStructEnd(); err != nil { 6467 goto ReadStructEndError 6468 } 6469 6470 return nil 6471 ReadStructBeginError: 6472 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 6473 ReadFieldBeginError: 6474 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 6475 ReadFieldError: 6476 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceExampleSuperMethodResult[fieldId]), err) 6477 SkipFieldError: 6478 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 6479 6480 ReadFieldEndError: 6481 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 6482 ReadStructEndError: 6483 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 6484 } 6485 6486 func (p *ExampleServiceExampleSuperMethodResult) ReadField0(iprot thrift.TProtocol) error { 6487 p.Success = NewA() 6488 if err := p.Success.Read(iprot); err != nil { 6489 return err 6490 } 6491 return nil 6492 } 6493 6494 func (p *ExampleServiceExampleSuperMethodResult) Write(oprot thrift.TProtocol) (err error) { 6495 var fieldId int16 6496 if err = oprot.WriteStructBegin("ExampleSuperMethod_result"); err != nil { 6497 goto WriteStructBeginError 6498 } 6499 if p != nil { 6500 if err = p.writeField0(oprot); err != nil { 6501 fieldId = 0 6502 goto WriteFieldError 6503 } 6504 6505 } 6506 if err = oprot.WriteFieldStop(); err != nil { 6507 goto WriteFieldStopError 6508 } 6509 if err = oprot.WriteStructEnd(); err != nil { 6510 goto WriteStructEndError 6511 } 6512 return nil 6513 WriteStructBeginError: 6514 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 6515 WriteFieldError: 6516 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 6517 WriteFieldStopError: 6518 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 6519 WriteStructEndError: 6520 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 6521 } 6522 6523 func (p *ExampleServiceExampleSuperMethodResult) writeField0(oprot thrift.TProtocol) (err error) { 6524 if p.IsSetSuccess() { 6525 if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 6526 goto WriteFieldBeginError 6527 } 6528 if err := p.Success.Write(oprot); err != nil { 6529 return err 6530 } 6531 if err = oprot.WriteFieldEnd(); err != nil { 6532 goto WriteFieldEndError 6533 } 6534 } 6535 return nil 6536 WriteFieldBeginError: 6537 return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) 6538 WriteFieldEndError: 6539 return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) 6540 } 6541 6542 func (p *ExampleServiceExampleSuperMethodResult) String() string { 6543 if p == nil { 6544 return "<nil>" 6545 } 6546 return fmt.Sprintf("ExampleServiceExampleSuperMethodResult(%+v)", *p) 6547 } 6548 6549 func (p *ExampleServiceExampleSuperMethodResult) DeepEqual(ano *ExampleServiceExampleSuperMethodResult) bool { 6550 if p == ano { 6551 return true 6552 } else if p == nil || ano == nil { 6553 return false 6554 } 6555 if !p.Field0DeepEqual(ano.Success) { 6556 return false 6557 } 6558 return true 6559 } 6560 6561 func (p *ExampleServiceExampleSuperMethodResult) Field0DeepEqual(src *A) bool { 6562 6563 if !p.Success.DeepEqual(src) { 6564 return false 6565 } 6566 return true 6567 } 6568 6569 type ExampleServiceFooArgs struct { 6570 Req *A `thrift:"req,1" json:"req"` 6571 } 6572 6573 func NewExampleServiceFooArgs() *ExampleServiceFooArgs { 6574 return &ExampleServiceFooArgs{} 6575 } 6576 6577 var ExampleServiceFooArgs_Req_DEFAULT *A 6578 6579 func (p *ExampleServiceFooArgs) GetReq() (v *A) { 6580 if !p.IsSetReq() { 6581 return ExampleServiceFooArgs_Req_DEFAULT 6582 } 6583 return p.Req 6584 } 6585 func (p *ExampleServiceFooArgs) SetReq(val *A) { 6586 p.Req = val 6587 } 6588 6589 var fieldIDToName_ExampleServiceFooArgs = map[int16]string{ 6590 1: "req", 6591 } 6592 6593 func (p *ExampleServiceFooArgs) IsSetReq() bool { 6594 return p.Req != nil 6595 } 6596 6597 func (p *ExampleServiceFooArgs) Read(iprot thrift.TProtocol) (err error) { 6598 6599 var fieldTypeId thrift.TType 6600 var fieldId int16 6601 6602 if _, err = iprot.ReadStructBegin(); err != nil { 6603 goto ReadStructBeginError 6604 } 6605 6606 for { 6607 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 6608 if err != nil { 6609 goto ReadFieldBeginError 6610 } 6611 if fieldTypeId == thrift.STOP { 6612 break 6613 } 6614 6615 switch fieldId { 6616 case 1: 6617 if fieldTypeId == thrift.STRUCT { 6618 if err = p.ReadField1(iprot); err != nil { 6619 goto ReadFieldError 6620 } 6621 } else { 6622 if err = iprot.Skip(fieldTypeId); err != nil { 6623 goto SkipFieldError 6624 } 6625 } 6626 default: 6627 if err = iprot.Skip(fieldTypeId); err != nil { 6628 goto SkipFieldError 6629 } 6630 } 6631 6632 if err = iprot.ReadFieldEnd(); err != nil { 6633 goto ReadFieldEndError 6634 } 6635 } 6636 if err = iprot.ReadStructEnd(); err != nil { 6637 goto ReadStructEndError 6638 } 6639 6640 return nil 6641 ReadStructBeginError: 6642 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 6643 ReadFieldBeginError: 6644 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 6645 ReadFieldError: 6646 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceFooArgs[fieldId]), err) 6647 SkipFieldError: 6648 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 6649 6650 ReadFieldEndError: 6651 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 6652 ReadStructEndError: 6653 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 6654 } 6655 6656 func (p *ExampleServiceFooArgs) ReadField1(iprot thrift.TProtocol) error { 6657 p.Req = NewA() 6658 if err := p.Req.Read(iprot); err != nil { 6659 return err 6660 } 6661 return nil 6662 } 6663 6664 func (p *ExampleServiceFooArgs) Write(oprot thrift.TProtocol) (err error) { 6665 var fieldId int16 6666 if err = oprot.WriteStructBegin("Foo_args"); err != nil { 6667 goto WriteStructBeginError 6668 } 6669 if p != nil { 6670 if err = p.writeField1(oprot); err != nil { 6671 fieldId = 1 6672 goto WriteFieldError 6673 } 6674 6675 } 6676 if err = oprot.WriteFieldStop(); err != nil { 6677 goto WriteFieldStopError 6678 } 6679 if err = oprot.WriteStructEnd(); err != nil { 6680 goto WriteStructEndError 6681 } 6682 return nil 6683 WriteStructBeginError: 6684 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 6685 WriteFieldError: 6686 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 6687 WriteFieldStopError: 6688 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 6689 WriteStructEndError: 6690 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 6691 } 6692 6693 func (p *ExampleServiceFooArgs) writeField1(oprot thrift.TProtocol) (err error) { 6694 if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { 6695 goto WriteFieldBeginError 6696 } 6697 if err := p.Req.Write(oprot); err != nil { 6698 return err 6699 } 6700 if err = oprot.WriteFieldEnd(); err != nil { 6701 goto WriteFieldEndError 6702 } 6703 return nil 6704 WriteFieldBeginError: 6705 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 6706 WriteFieldEndError: 6707 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 6708 } 6709 6710 func (p *ExampleServiceFooArgs) String() string { 6711 if p == nil { 6712 return "<nil>" 6713 } 6714 return fmt.Sprintf("ExampleServiceFooArgs(%+v)", *p) 6715 } 6716 6717 func (p *ExampleServiceFooArgs) DeepEqual(ano *ExampleServiceFooArgs) bool { 6718 if p == ano { 6719 return true 6720 } else if p == nil || ano == nil { 6721 return false 6722 } 6723 if !p.Field1DeepEqual(ano.Req) { 6724 return false 6725 } 6726 return true 6727 } 6728 6729 func (p *ExampleServiceFooArgs) Field1DeepEqual(src *A) bool { 6730 6731 if !p.Req.DeepEqual(src) { 6732 return false 6733 } 6734 return true 6735 } 6736 6737 type ExampleServiceFooResult struct { 6738 Success *A `thrift:"success,0" json:"success,omitempty"` 6739 } 6740 6741 func NewExampleServiceFooResult() *ExampleServiceFooResult { 6742 return &ExampleServiceFooResult{} 6743 } 6744 6745 var ExampleServiceFooResult_Success_DEFAULT *A 6746 6747 func (p *ExampleServiceFooResult) GetSuccess() (v *A) { 6748 if !p.IsSetSuccess() { 6749 return ExampleServiceFooResult_Success_DEFAULT 6750 } 6751 return p.Success 6752 } 6753 func (p *ExampleServiceFooResult) SetSuccess(x interface{}) { 6754 p.Success = x.(*A) 6755 } 6756 6757 var fieldIDToName_ExampleServiceFooResult = map[int16]string{ 6758 0: "success", 6759 } 6760 6761 func (p *ExampleServiceFooResult) IsSetSuccess() bool { 6762 return p.Success != nil 6763 } 6764 6765 func (p *ExampleServiceFooResult) Read(iprot thrift.TProtocol) (err error) { 6766 6767 var fieldTypeId thrift.TType 6768 var fieldId int16 6769 6770 if _, err = iprot.ReadStructBegin(); err != nil { 6771 goto ReadStructBeginError 6772 } 6773 6774 for { 6775 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 6776 if err != nil { 6777 goto ReadFieldBeginError 6778 } 6779 if fieldTypeId == thrift.STOP { 6780 break 6781 } 6782 6783 switch fieldId { 6784 case 0: 6785 if fieldTypeId == thrift.STRUCT { 6786 if err = p.ReadField0(iprot); err != nil { 6787 goto ReadFieldError 6788 } 6789 } else { 6790 if err = iprot.Skip(fieldTypeId); err != nil { 6791 goto SkipFieldError 6792 } 6793 } 6794 default: 6795 if err = iprot.Skip(fieldTypeId); err != nil { 6796 goto SkipFieldError 6797 } 6798 } 6799 6800 if err = iprot.ReadFieldEnd(); err != nil { 6801 goto ReadFieldEndError 6802 } 6803 } 6804 if err = iprot.ReadStructEnd(); err != nil { 6805 goto ReadStructEndError 6806 } 6807 6808 return nil 6809 ReadStructBeginError: 6810 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 6811 ReadFieldBeginError: 6812 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 6813 ReadFieldError: 6814 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceFooResult[fieldId]), err) 6815 SkipFieldError: 6816 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 6817 6818 ReadFieldEndError: 6819 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 6820 ReadStructEndError: 6821 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 6822 } 6823 6824 func (p *ExampleServiceFooResult) ReadField0(iprot thrift.TProtocol) error { 6825 p.Success = NewA() 6826 if err := p.Success.Read(iprot); err != nil { 6827 return err 6828 } 6829 return nil 6830 } 6831 6832 func (p *ExampleServiceFooResult) Write(oprot thrift.TProtocol) (err error) { 6833 var fieldId int16 6834 if err = oprot.WriteStructBegin("Foo_result"); err != nil { 6835 goto WriteStructBeginError 6836 } 6837 if p != nil { 6838 if err = p.writeField0(oprot); err != nil { 6839 fieldId = 0 6840 goto WriteFieldError 6841 } 6842 6843 } 6844 if err = oprot.WriteFieldStop(); err != nil { 6845 goto WriteFieldStopError 6846 } 6847 if err = oprot.WriteStructEnd(); err != nil { 6848 goto WriteStructEndError 6849 } 6850 return nil 6851 WriteStructBeginError: 6852 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 6853 WriteFieldError: 6854 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 6855 WriteFieldStopError: 6856 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 6857 WriteStructEndError: 6858 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 6859 } 6860 6861 func (p *ExampleServiceFooResult) writeField0(oprot thrift.TProtocol) (err error) { 6862 if p.IsSetSuccess() { 6863 if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { 6864 goto WriteFieldBeginError 6865 } 6866 if err := p.Success.Write(oprot); err != nil { 6867 return err 6868 } 6869 if err = oprot.WriteFieldEnd(); err != nil { 6870 goto WriteFieldEndError 6871 } 6872 } 6873 return nil 6874 WriteFieldBeginError: 6875 return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) 6876 WriteFieldEndError: 6877 return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) 6878 } 6879 6880 func (p *ExampleServiceFooResult) String() string { 6881 if p == nil { 6882 return "<nil>" 6883 } 6884 return fmt.Sprintf("ExampleServiceFooResult(%+v)", *p) 6885 } 6886 6887 func (p *ExampleServiceFooResult) DeepEqual(ano *ExampleServiceFooResult) bool { 6888 if p == ano { 6889 return true 6890 } else if p == nil || ano == nil { 6891 return false 6892 } 6893 if !p.Field0DeepEqual(ano.Success) { 6894 return false 6895 } 6896 return true 6897 } 6898 6899 func (p *ExampleServiceFooResult) Field0DeepEqual(src *A) bool { 6900 6901 if !p.Success.DeepEqual(src) { 6902 return false 6903 } 6904 return true 6905 } 6906 6907 type ExampleServicePingArgs struct { 6908 Msg string `thrift:"msg,1" json:"msg"` 6909 } 6910 6911 func NewExampleServicePingArgs() *ExampleServicePingArgs { 6912 return &ExampleServicePingArgs{} 6913 } 6914 6915 func (p *ExampleServicePingArgs) GetMsg() (v string) { 6916 return p.Msg 6917 } 6918 func (p *ExampleServicePingArgs) SetMsg(val string) { 6919 p.Msg = val 6920 } 6921 6922 var fieldIDToName_ExampleServicePingArgs = map[int16]string{ 6923 1: "msg", 6924 } 6925 6926 func (p *ExampleServicePingArgs) Read(iprot thrift.TProtocol) (err error) { 6927 6928 var fieldTypeId thrift.TType 6929 var fieldId int16 6930 6931 if _, err = iprot.ReadStructBegin(); err != nil { 6932 goto ReadStructBeginError 6933 } 6934 6935 for { 6936 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 6937 if err != nil { 6938 goto ReadFieldBeginError 6939 } 6940 if fieldTypeId == thrift.STOP { 6941 break 6942 } 6943 6944 switch fieldId { 6945 case 1: 6946 if fieldTypeId == thrift.STRING { 6947 if err = p.ReadField1(iprot); err != nil { 6948 goto ReadFieldError 6949 } 6950 } else { 6951 if err = iprot.Skip(fieldTypeId); err != nil { 6952 goto SkipFieldError 6953 } 6954 } 6955 default: 6956 if err = iprot.Skip(fieldTypeId); err != nil { 6957 goto SkipFieldError 6958 } 6959 } 6960 6961 if err = iprot.ReadFieldEnd(); err != nil { 6962 goto ReadFieldEndError 6963 } 6964 } 6965 if err = iprot.ReadStructEnd(); err != nil { 6966 goto ReadStructEndError 6967 } 6968 6969 return nil 6970 ReadStructBeginError: 6971 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 6972 ReadFieldBeginError: 6973 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 6974 ReadFieldError: 6975 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServicePingArgs[fieldId]), err) 6976 SkipFieldError: 6977 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 6978 6979 ReadFieldEndError: 6980 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 6981 ReadStructEndError: 6982 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 6983 } 6984 6985 func (p *ExampleServicePingArgs) ReadField1(iprot thrift.TProtocol) error { 6986 if v, err := iprot.ReadString(); err != nil { 6987 return err 6988 } else { 6989 p.Msg = v 6990 } 6991 return nil 6992 } 6993 6994 func (p *ExampleServicePingArgs) Write(oprot thrift.TProtocol) (err error) { 6995 var fieldId int16 6996 if err = oprot.WriteStructBegin("Ping_args"); err != nil { 6997 goto WriteStructBeginError 6998 } 6999 if p != nil { 7000 if err = p.writeField1(oprot); err != nil { 7001 fieldId = 1 7002 goto WriteFieldError 7003 } 7004 7005 } 7006 if err = oprot.WriteFieldStop(); err != nil { 7007 goto WriteFieldStopError 7008 } 7009 if err = oprot.WriteStructEnd(); err != nil { 7010 goto WriteStructEndError 7011 } 7012 return nil 7013 WriteStructBeginError: 7014 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 7015 WriteFieldError: 7016 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 7017 WriteFieldStopError: 7018 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 7019 WriteStructEndError: 7020 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 7021 } 7022 7023 func (p *ExampleServicePingArgs) writeField1(oprot thrift.TProtocol) (err error) { 7024 if err = oprot.WriteFieldBegin("msg", thrift.STRING, 1); err != nil { 7025 goto WriteFieldBeginError 7026 } 7027 if err := oprot.WriteString(p.Msg); err != nil { 7028 return err 7029 } 7030 if err = oprot.WriteFieldEnd(); err != nil { 7031 goto WriteFieldEndError 7032 } 7033 return nil 7034 WriteFieldBeginError: 7035 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 7036 WriteFieldEndError: 7037 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 7038 } 7039 7040 func (p *ExampleServicePingArgs) String() string { 7041 if p == nil { 7042 return "<nil>" 7043 } 7044 return fmt.Sprintf("ExampleServicePingArgs(%+v)", *p) 7045 } 7046 7047 func (p *ExampleServicePingArgs) DeepEqual(ano *ExampleServicePingArgs) bool { 7048 if p == ano { 7049 return true 7050 } else if p == nil || ano == nil { 7051 return false 7052 } 7053 if !p.Field1DeepEqual(ano.Msg) { 7054 return false 7055 } 7056 return true 7057 } 7058 7059 func (p *ExampleServicePingArgs) Field1DeepEqual(src string) bool { 7060 7061 if strings.Compare(p.Msg, src) != 0 { 7062 return false 7063 } 7064 return true 7065 } 7066 7067 type ExampleServicePingResult struct { 7068 Success *string `thrift:"success,0" json:"success,omitempty"` 7069 } 7070 7071 func NewExampleServicePingResult() *ExampleServicePingResult { 7072 return &ExampleServicePingResult{} 7073 } 7074 7075 var ExampleServicePingResult_Success_DEFAULT string 7076 7077 func (p *ExampleServicePingResult) GetSuccess() (v string) { 7078 if !p.IsSetSuccess() { 7079 return ExampleServicePingResult_Success_DEFAULT 7080 } 7081 return *p.Success 7082 } 7083 func (p *ExampleServicePingResult) SetSuccess(x interface{}) { 7084 p.Success = x.(*string) 7085 } 7086 7087 var fieldIDToName_ExampleServicePingResult = map[int16]string{ 7088 0: "success", 7089 } 7090 7091 func (p *ExampleServicePingResult) IsSetSuccess() bool { 7092 return p.Success != nil 7093 } 7094 7095 func (p *ExampleServicePingResult) Read(iprot thrift.TProtocol) (err error) { 7096 7097 var fieldTypeId thrift.TType 7098 var fieldId int16 7099 7100 if _, err = iprot.ReadStructBegin(); err != nil { 7101 goto ReadStructBeginError 7102 } 7103 7104 for { 7105 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 7106 if err != nil { 7107 goto ReadFieldBeginError 7108 } 7109 if fieldTypeId == thrift.STOP { 7110 break 7111 } 7112 7113 switch fieldId { 7114 case 0: 7115 if fieldTypeId == thrift.STRING { 7116 if err = p.ReadField0(iprot); err != nil { 7117 goto ReadFieldError 7118 } 7119 } else { 7120 if err = iprot.Skip(fieldTypeId); err != nil { 7121 goto SkipFieldError 7122 } 7123 } 7124 default: 7125 if err = iprot.Skip(fieldTypeId); err != nil { 7126 goto SkipFieldError 7127 } 7128 } 7129 7130 if err = iprot.ReadFieldEnd(); err != nil { 7131 goto ReadFieldEndError 7132 } 7133 } 7134 if err = iprot.ReadStructEnd(); err != nil { 7135 goto ReadStructEndError 7136 } 7137 7138 return nil 7139 ReadStructBeginError: 7140 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 7141 ReadFieldBeginError: 7142 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 7143 ReadFieldError: 7144 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServicePingResult[fieldId]), err) 7145 SkipFieldError: 7146 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 7147 7148 ReadFieldEndError: 7149 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 7150 ReadStructEndError: 7151 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 7152 } 7153 7154 func (p *ExampleServicePingResult) ReadField0(iprot thrift.TProtocol) error { 7155 if v, err := iprot.ReadString(); err != nil { 7156 return err 7157 } else { 7158 p.Success = &v 7159 } 7160 return nil 7161 } 7162 7163 func (p *ExampleServicePingResult) Write(oprot thrift.TProtocol) (err error) { 7164 var fieldId int16 7165 if err = oprot.WriteStructBegin("Ping_result"); err != nil { 7166 goto WriteStructBeginError 7167 } 7168 if p != nil { 7169 if err = p.writeField0(oprot); err != nil { 7170 fieldId = 0 7171 goto WriteFieldError 7172 } 7173 7174 } 7175 if err = oprot.WriteFieldStop(); err != nil { 7176 goto WriteFieldStopError 7177 } 7178 if err = oprot.WriteStructEnd(); err != nil { 7179 goto WriteStructEndError 7180 } 7181 return nil 7182 WriteStructBeginError: 7183 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 7184 WriteFieldError: 7185 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 7186 WriteFieldStopError: 7187 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 7188 WriteStructEndError: 7189 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 7190 } 7191 7192 func (p *ExampleServicePingResult) writeField0(oprot thrift.TProtocol) (err error) { 7193 if p.IsSetSuccess() { 7194 if err = oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil { 7195 goto WriteFieldBeginError 7196 } 7197 if err := oprot.WriteString(*p.Success); err != nil { 7198 return err 7199 } 7200 if err = oprot.WriteFieldEnd(); err != nil { 7201 goto WriteFieldEndError 7202 } 7203 } 7204 return nil 7205 WriteFieldBeginError: 7206 return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) 7207 WriteFieldEndError: 7208 return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) 7209 } 7210 7211 func (p *ExampleServicePingResult) String() string { 7212 if p == nil { 7213 return "<nil>" 7214 } 7215 return fmt.Sprintf("ExampleServicePingResult(%+v)", *p) 7216 } 7217 7218 func (p *ExampleServicePingResult) DeepEqual(ano *ExampleServicePingResult) bool { 7219 if p == ano { 7220 return true 7221 } else if p == nil || ano == nil { 7222 return false 7223 } 7224 if !p.Field0DeepEqual(ano.Success) { 7225 return false 7226 } 7227 return true 7228 } 7229 7230 func (p *ExampleServicePingResult) Field0DeepEqual(src *string) bool { 7231 7232 if p.Success == src { 7233 return true 7234 } else if p.Success == nil || src == nil { 7235 return false 7236 } 7237 if strings.Compare(*p.Success, *src) != 0 { 7238 return false 7239 } 7240 return true 7241 } 7242 7243 type ExampleServiceOnewayArgs struct { 7244 Msg string `thrift:"msg,1" json:"msg"` 7245 } 7246 7247 func NewExampleServiceOnewayArgs() *ExampleServiceOnewayArgs { 7248 return &ExampleServiceOnewayArgs{} 7249 } 7250 7251 func (p *ExampleServiceOnewayArgs) GetMsg() (v string) { 7252 return p.Msg 7253 } 7254 func (p *ExampleServiceOnewayArgs) SetMsg(val string) { 7255 p.Msg = val 7256 } 7257 7258 var fieldIDToName_ExampleServiceOnewayArgs = map[int16]string{ 7259 1: "msg", 7260 } 7261 7262 func (p *ExampleServiceOnewayArgs) Read(iprot thrift.TProtocol) (err error) { 7263 7264 var fieldTypeId thrift.TType 7265 var fieldId int16 7266 7267 if _, err = iprot.ReadStructBegin(); err != nil { 7268 goto ReadStructBeginError 7269 } 7270 7271 for { 7272 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 7273 if err != nil { 7274 goto ReadFieldBeginError 7275 } 7276 if fieldTypeId == thrift.STOP { 7277 break 7278 } 7279 7280 switch fieldId { 7281 case 1: 7282 if fieldTypeId == thrift.STRING { 7283 if err = p.ReadField1(iprot); err != nil { 7284 goto ReadFieldError 7285 } 7286 } else { 7287 if err = iprot.Skip(fieldTypeId); err != nil { 7288 goto SkipFieldError 7289 } 7290 } 7291 default: 7292 if err = iprot.Skip(fieldTypeId); err != nil { 7293 goto SkipFieldError 7294 } 7295 } 7296 7297 if err = iprot.ReadFieldEnd(); err != nil { 7298 goto ReadFieldEndError 7299 } 7300 } 7301 if err = iprot.ReadStructEnd(); err != nil { 7302 goto ReadStructEndError 7303 } 7304 7305 return nil 7306 ReadStructBeginError: 7307 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 7308 ReadFieldBeginError: 7309 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 7310 ReadFieldError: 7311 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceOnewayArgs[fieldId]), err) 7312 SkipFieldError: 7313 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 7314 7315 ReadFieldEndError: 7316 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 7317 ReadStructEndError: 7318 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 7319 } 7320 7321 func (p *ExampleServiceOnewayArgs) ReadField1(iprot thrift.TProtocol) error { 7322 if v, err := iprot.ReadString(); err != nil { 7323 return err 7324 } else { 7325 p.Msg = v 7326 } 7327 return nil 7328 } 7329 7330 func (p *ExampleServiceOnewayArgs) Write(oprot thrift.TProtocol) (err error) { 7331 var fieldId int16 7332 if err = oprot.WriteStructBegin("Oneway_args"); err != nil { 7333 goto WriteStructBeginError 7334 } 7335 if p != nil { 7336 if err = p.writeField1(oprot); err != nil { 7337 fieldId = 1 7338 goto WriteFieldError 7339 } 7340 7341 } 7342 if err = oprot.WriteFieldStop(); err != nil { 7343 goto WriteFieldStopError 7344 } 7345 if err = oprot.WriteStructEnd(); err != nil { 7346 goto WriteStructEndError 7347 } 7348 return nil 7349 WriteStructBeginError: 7350 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 7351 WriteFieldError: 7352 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 7353 WriteFieldStopError: 7354 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 7355 WriteStructEndError: 7356 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 7357 } 7358 7359 func (p *ExampleServiceOnewayArgs) writeField1(oprot thrift.TProtocol) (err error) { 7360 if err = oprot.WriteFieldBegin("msg", thrift.STRING, 1); err != nil { 7361 goto WriteFieldBeginError 7362 } 7363 if err := oprot.WriteString(p.Msg); err != nil { 7364 return err 7365 } 7366 if err = oprot.WriteFieldEnd(); err != nil { 7367 goto WriteFieldEndError 7368 } 7369 return nil 7370 WriteFieldBeginError: 7371 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 7372 WriteFieldEndError: 7373 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 7374 } 7375 7376 func (p *ExampleServiceOnewayArgs) String() string { 7377 if p == nil { 7378 return "<nil>" 7379 } 7380 return fmt.Sprintf("ExampleServiceOnewayArgs(%+v)", *p) 7381 } 7382 7383 func (p *ExampleServiceOnewayArgs) DeepEqual(ano *ExampleServiceOnewayArgs) bool { 7384 if p == ano { 7385 return true 7386 } else if p == nil || ano == nil { 7387 return false 7388 } 7389 if !p.Field1DeepEqual(ano.Msg) { 7390 return false 7391 } 7392 return true 7393 } 7394 7395 func (p *ExampleServiceOnewayArgs) Field1DeepEqual(src string) bool { 7396 7397 if strings.Compare(p.Msg, src) != 0 { 7398 return false 7399 } 7400 return true 7401 } 7402 7403 type ExampleServiceVoidArgs struct { 7404 Msg string `thrift:"msg,1" json:"msg"` 7405 } 7406 7407 func NewExampleServiceVoidArgs() *ExampleServiceVoidArgs { 7408 return &ExampleServiceVoidArgs{} 7409 } 7410 7411 func (p *ExampleServiceVoidArgs) GetMsg() (v string) { 7412 return p.Msg 7413 } 7414 func (p *ExampleServiceVoidArgs) SetMsg(val string) { 7415 p.Msg = val 7416 } 7417 7418 var fieldIDToName_ExampleServiceVoidArgs = map[int16]string{ 7419 1: "msg", 7420 } 7421 7422 func (p *ExampleServiceVoidArgs) Read(iprot thrift.TProtocol) (err error) { 7423 7424 var fieldTypeId thrift.TType 7425 var fieldId int16 7426 7427 if _, err = iprot.ReadStructBegin(); err != nil { 7428 goto ReadStructBeginError 7429 } 7430 7431 for { 7432 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 7433 if err != nil { 7434 goto ReadFieldBeginError 7435 } 7436 if fieldTypeId == thrift.STOP { 7437 break 7438 } 7439 7440 switch fieldId { 7441 case 1: 7442 if fieldTypeId == thrift.STRING { 7443 if err = p.ReadField1(iprot); err != nil { 7444 goto ReadFieldError 7445 } 7446 } else { 7447 if err = iprot.Skip(fieldTypeId); err != nil { 7448 goto SkipFieldError 7449 } 7450 } 7451 default: 7452 if err = iprot.Skip(fieldTypeId); err != nil { 7453 goto SkipFieldError 7454 } 7455 } 7456 7457 if err = iprot.ReadFieldEnd(); err != nil { 7458 goto ReadFieldEndError 7459 } 7460 } 7461 if err = iprot.ReadStructEnd(); err != nil { 7462 goto ReadStructEndError 7463 } 7464 7465 return nil 7466 ReadStructBeginError: 7467 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 7468 ReadFieldBeginError: 7469 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 7470 ReadFieldError: 7471 return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ExampleServiceVoidArgs[fieldId]), err) 7472 SkipFieldError: 7473 return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) 7474 7475 ReadFieldEndError: 7476 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 7477 ReadStructEndError: 7478 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 7479 } 7480 7481 func (p *ExampleServiceVoidArgs) ReadField1(iprot thrift.TProtocol) error { 7482 if v, err := iprot.ReadString(); err != nil { 7483 return err 7484 } else { 7485 p.Msg = v 7486 } 7487 return nil 7488 } 7489 7490 func (p *ExampleServiceVoidArgs) Write(oprot thrift.TProtocol) (err error) { 7491 var fieldId int16 7492 if err = oprot.WriteStructBegin("Void_args"); err != nil { 7493 goto WriteStructBeginError 7494 } 7495 if p != nil { 7496 if err = p.writeField1(oprot); err != nil { 7497 fieldId = 1 7498 goto WriteFieldError 7499 } 7500 7501 } 7502 if err = oprot.WriteFieldStop(); err != nil { 7503 goto WriteFieldStopError 7504 } 7505 if err = oprot.WriteStructEnd(); err != nil { 7506 goto WriteStructEndError 7507 } 7508 return nil 7509 WriteStructBeginError: 7510 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 7511 WriteFieldError: 7512 return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) 7513 WriteFieldStopError: 7514 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 7515 WriteStructEndError: 7516 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 7517 } 7518 7519 func (p *ExampleServiceVoidArgs) writeField1(oprot thrift.TProtocol) (err error) { 7520 if err = oprot.WriteFieldBegin("msg", thrift.STRING, 1); err != nil { 7521 goto WriteFieldBeginError 7522 } 7523 if err := oprot.WriteString(p.Msg); err != nil { 7524 return err 7525 } 7526 if err = oprot.WriteFieldEnd(); err != nil { 7527 goto WriteFieldEndError 7528 } 7529 return nil 7530 WriteFieldBeginError: 7531 return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) 7532 WriteFieldEndError: 7533 return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) 7534 } 7535 7536 func (p *ExampleServiceVoidArgs) String() string { 7537 if p == nil { 7538 return "<nil>" 7539 } 7540 return fmt.Sprintf("ExampleServiceVoidArgs(%+v)", *p) 7541 } 7542 7543 func (p *ExampleServiceVoidArgs) DeepEqual(ano *ExampleServiceVoidArgs) bool { 7544 if p == ano { 7545 return true 7546 } else if p == nil || ano == nil { 7547 return false 7548 } 7549 if !p.Field1DeepEqual(ano.Msg) { 7550 return false 7551 } 7552 return true 7553 } 7554 7555 func (p *ExampleServiceVoidArgs) Field1DeepEqual(src string) bool { 7556 7557 if strings.Compare(p.Msg, src) != 0 { 7558 return false 7559 } 7560 return true 7561 } 7562 7563 type ExampleServiceVoidResult struct { 7564 } 7565 7566 func NewExampleServiceVoidResult() *ExampleServiceVoidResult { 7567 return &ExampleServiceVoidResult{} 7568 } 7569 7570 var fieldIDToName_ExampleServiceVoidResult = map[int16]string{} 7571 7572 func (p *ExampleServiceVoidResult) Read(iprot thrift.TProtocol) (err error) { 7573 7574 var fieldTypeId thrift.TType 7575 var fieldId int16 7576 7577 if _, err = iprot.ReadStructBegin(); err != nil { 7578 goto ReadStructBeginError 7579 } 7580 7581 for { 7582 _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() 7583 if err != nil { 7584 goto ReadFieldBeginError 7585 } 7586 if fieldTypeId == thrift.STOP { 7587 break 7588 } 7589 if err = iprot.Skip(fieldTypeId); err != nil { 7590 goto SkipFieldTypeError 7591 } 7592 7593 if err = iprot.ReadFieldEnd(); err != nil { 7594 goto ReadFieldEndError 7595 } 7596 } 7597 if err = iprot.ReadStructEnd(); err != nil { 7598 goto ReadStructEndError 7599 } 7600 7601 return nil 7602 ReadStructBeginError: 7603 return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) 7604 ReadFieldBeginError: 7605 return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) 7606 SkipFieldTypeError: 7607 return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) 7608 7609 ReadFieldEndError: 7610 return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) 7611 ReadStructEndError: 7612 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) 7613 } 7614 7615 func (p *ExampleServiceVoidResult) Write(oprot thrift.TProtocol) (err error) { 7616 if err = oprot.WriteStructBegin("Void_result"); err != nil { 7617 goto WriteStructBeginError 7618 } 7619 if p != nil { 7620 7621 } 7622 if err = oprot.WriteFieldStop(); err != nil { 7623 goto WriteFieldStopError 7624 } 7625 if err = oprot.WriteStructEnd(); err != nil { 7626 goto WriteStructEndError 7627 } 7628 return nil 7629 WriteStructBeginError: 7630 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) 7631 WriteFieldStopError: 7632 return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) 7633 WriteStructEndError: 7634 return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) 7635 } 7636 7637 func (p *ExampleServiceVoidResult) String() string { 7638 if p == nil { 7639 return "<nil>" 7640 } 7641 return fmt.Sprintf("ExampleServiceVoidResult(%+v)", *p) 7642 } 7643 7644 func (p *ExampleServiceVoidResult) DeepEqual(ano *ExampleServiceVoidResult) bool { 7645 if p == ano { 7646 return true 7647 } else if p == nil || ano == nil { 7648 return false 7649 } 7650 return true 7651 }