github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/object/types.go (about) 1 package object 2 3 import ( 4 "github.com/TrueCloudLab/frostfs-api-go/v2/refs" 5 "github.com/TrueCloudLab/frostfs-api-go/v2/session" 6 ) 7 8 type Type uint32 9 10 type MatchType uint32 11 12 type ShortHeader struct { 13 version *refs.Version 14 15 creatEpoch uint64 16 17 ownerID *refs.OwnerID 18 19 typ Type 20 21 payloadLen uint64 22 23 payloadHash, homoHash *refs.Checksum 24 } 25 26 type Attribute struct { 27 key, val string 28 } 29 30 type SplitHeader struct { 31 par, prev *refs.ObjectID 32 33 parSig *refs.Signature 34 35 parHdr *Header 36 37 children []refs.ObjectID 38 39 splitID []byte 40 } 41 42 type Header struct { 43 version *refs.Version 44 45 cid *refs.ContainerID 46 47 ownerID *refs.OwnerID 48 49 creatEpoch uint64 50 51 payloadLen uint64 52 53 payloadHash, homoHash *refs.Checksum 54 55 typ Type 56 57 sessionToken *session.Token 58 59 attr []Attribute 60 61 split *SplitHeader 62 } 63 64 type HeaderWithSignature struct { 65 header *Header 66 67 signature *refs.Signature 68 } 69 70 type Object struct { 71 objectID *refs.ObjectID 72 73 idSig *refs.Signature 74 75 header *Header 76 77 payload []byte 78 } 79 80 type SplitInfo struct { 81 splitID []byte 82 83 lastPart *refs.ObjectID 84 85 link *refs.ObjectID 86 } 87 88 type GetRequestBody struct { 89 addr *refs.Address 90 91 raw bool 92 } 93 94 type GetObjectPart interface { 95 getObjectPart() 96 } 97 98 type GetObjectPartInit struct { 99 id *refs.ObjectID 100 101 sig *refs.Signature 102 103 hdr *Header 104 } 105 106 type GetObjectPartChunk struct { 107 chunk []byte 108 } 109 110 type GetRequest struct { 111 body *GetRequestBody 112 113 session.RequestHeaders 114 } 115 116 type GetResponseBody struct { 117 objPart GetObjectPart 118 } 119 120 type PutObjectPart interface { 121 putObjectPart() 122 } 123 124 type PutObjectPartInit struct { 125 id *refs.ObjectID 126 127 sig *refs.Signature 128 129 hdr *Header 130 131 copyNum uint32 132 } 133 134 type PutObjectPartChunk struct { 135 chunk []byte 136 } 137 138 type GetResponse struct { 139 body *GetResponseBody 140 141 session.ResponseHeaders 142 } 143 144 type PutRequestBody struct { 145 objPart PutObjectPart 146 } 147 148 type PutRequest struct { 149 body *PutRequestBody 150 151 session.RequestHeaders 152 } 153 154 type PutResponseBody struct { 155 id *refs.ObjectID 156 } 157 158 type PutResponse struct { 159 body *PutResponseBody 160 161 session.ResponseHeaders 162 } 163 164 type DeleteRequestBody struct { 165 addr *refs.Address 166 } 167 168 type DeleteRequest struct { 169 body *DeleteRequestBody 170 171 session.RequestHeaders 172 } 173 174 type DeleteResponseBody struct { 175 tombstone *refs.Address 176 } 177 178 type DeleteResponse struct { 179 body *DeleteResponseBody 180 181 session.ResponseHeaders 182 } 183 184 type HeadRequestBody struct { 185 addr *refs.Address 186 187 mainOnly, raw bool 188 } 189 190 type GetHeaderPart interface { 191 getHeaderPart() 192 } 193 194 type HeadRequest struct { 195 body *HeadRequestBody 196 197 session.RequestHeaders 198 } 199 200 type HeadResponseBody struct { 201 hdrPart GetHeaderPart 202 } 203 204 type HeadResponse struct { 205 body *HeadResponseBody 206 207 session.ResponseHeaders 208 } 209 210 type SearchFilter struct { 211 matchType MatchType 212 213 key, val string 214 } 215 216 type SearchRequestBody struct { 217 cid *refs.ContainerID 218 219 version uint32 220 221 filters []SearchFilter 222 } 223 224 type SearchRequest struct { 225 body *SearchRequestBody 226 227 session.RequestHeaders 228 } 229 230 type SearchResponseBody struct { 231 idList []refs.ObjectID 232 } 233 234 type SearchResponse struct { 235 body *SearchResponseBody 236 237 session.ResponseHeaders 238 } 239 240 type Range struct { 241 off, len uint64 242 } 243 244 type GetRangeRequestBody struct { 245 addr *refs.Address 246 247 rng *Range 248 249 raw bool 250 } 251 252 type GetRangeRequest struct { 253 body *GetRangeRequestBody 254 255 session.RequestHeaders 256 } 257 258 type GetRangePart interface { 259 getRangePart() 260 } 261 262 type GetRangePartChunk struct { 263 chunk []byte 264 } 265 266 type GetRangeResponseBody struct { 267 rngPart GetRangePart 268 } 269 270 type GetRangeResponse struct { 271 body *GetRangeResponseBody 272 273 session.ResponseHeaders 274 } 275 276 type GetRangeHashRequestBody struct { 277 addr *refs.Address 278 279 rngs []Range 280 281 salt []byte 282 283 typ refs.ChecksumType 284 } 285 286 type GetRangeHashRequest struct { 287 body *GetRangeHashRequestBody 288 289 session.RequestHeaders 290 } 291 292 type GetRangeHashResponseBody struct { 293 typ refs.ChecksumType 294 295 hashList [][]byte 296 } 297 298 type GetRangeHashResponse struct { 299 body *GetRangeHashResponseBody 300 301 session.ResponseHeaders 302 } 303 304 const ( 305 TypeRegular Type = iota 306 TypeTombstone 307 TypeStorageGroup 308 TypeLock 309 ) 310 311 const ( 312 MatchUnknown MatchType = iota 313 MatchStringEqual 314 MatchStringNotEqual 315 MatchNotPresent 316 MatchCommonPrefix 317 ) 318 319 func (h *ShortHeader) GetVersion() *refs.Version { 320 if h != nil { 321 return h.version 322 } 323 324 return nil 325 } 326 327 func (h *ShortHeader) SetVersion(v *refs.Version) { 328 h.version = v 329 } 330 331 func (h *ShortHeader) GetCreationEpoch() uint64 { 332 if h != nil { 333 return h.creatEpoch 334 } 335 336 return 0 337 } 338 339 func (h *ShortHeader) SetCreationEpoch(v uint64) { 340 h.creatEpoch = v 341 } 342 343 func (h *ShortHeader) GetOwnerID() *refs.OwnerID { 344 if h != nil { 345 return h.ownerID 346 } 347 348 return nil 349 } 350 351 func (h *ShortHeader) SetOwnerID(v *refs.OwnerID) { 352 h.ownerID = v 353 } 354 355 func (h *ShortHeader) GetObjectType() Type { 356 if h != nil { 357 return h.typ 358 } 359 360 return TypeRegular 361 } 362 363 func (h *ShortHeader) SetObjectType(v Type) { 364 h.typ = v 365 } 366 367 func (h *ShortHeader) GetPayloadLength() uint64 { 368 if h != nil { 369 return h.payloadLen 370 } 371 372 return 0 373 } 374 375 func (h *ShortHeader) SetPayloadLength(v uint64) { 376 h.payloadLen = v 377 } 378 379 func (h *ShortHeader) GetPayloadHash() *refs.Checksum { 380 if h != nil { 381 return h.payloadHash 382 } 383 384 return nil 385 } 386 387 func (h *ShortHeader) SetPayloadHash(v *refs.Checksum) { 388 h.payloadHash = v 389 } 390 391 func (h *ShortHeader) GetHomomorphicHash() *refs.Checksum { 392 if h != nil { 393 return h.homoHash 394 } 395 396 return nil 397 } 398 399 func (h *ShortHeader) SetHomomorphicHash(v *refs.Checksum) { 400 h.homoHash = v 401 } 402 403 func (h *ShortHeader) getHeaderPart() {} 404 405 func (a *Attribute) GetKey() string { 406 if a != nil { 407 return a.key 408 } 409 410 return "" 411 } 412 413 func (a *Attribute) SetKey(v string) { 414 a.key = v 415 } 416 417 func (a *Attribute) GetValue() string { 418 if a != nil { 419 return a.val 420 } 421 422 return "" 423 } 424 425 func (a *Attribute) SetValue(v string) { 426 a.val = v 427 } 428 429 func (h *SplitHeader) GetParent() *refs.ObjectID { 430 if h != nil { 431 return h.par 432 } 433 434 return nil 435 } 436 437 func (h *SplitHeader) SetParent(v *refs.ObjectID) { 438 h.par = v 439 } 440 441 func (h *SplitHeader) GetPrevious() *refs.ObjectID { 442 if h != nil { 443 return h.prev 444 } 445 446 return nil 447 } 448 449 func (h *SplitHeader) SetPrevious(v *refs.ObjectID) { 450 h.prev = v 451 } 452 453 func (h *SplitHeader) GetParentSignature() *refs.Signature { 454 if h != nil { 455 return h.parSig 456 } 457 458 return nil 459 } 460 461 func (h *SplitHeader) SetParentSignature(v *refs.Signature) { 462 h.parSig = v 463 } 464 465 func (h *SplitHeader) GetParentHeader() *Header { 466 if h != nil { 467 return h.parHdr 468 } 469 470 return nil 471 } 472 473 func (h *SplitHeader) SetParentHeader(v *Header) { 474 h.parHdr = v 475 } 476 477 func (h *SplitHeader) GetChildren() []refs.ObjectID { 478 if h != nil { 479 return h.children 480 } 481 482 return nil 483 } 484 485 func (h *SplitHeader) SetChildren(v []refs.ObjectID) { 486 h.children = v 487 } 488 489 func (h *SplitHeader) GetSplitID() []byte { 490 if h != nil { 491 return h.splitID 492 } 493 494 return nil 495 } 496 497 func (h *SplitHeader) SetSplitID(v []byte) { 498 h.splitID = v 499 } 500 501 func (h *Header) GetVersion() *refs.Version { 502 if h != nil { 503 return h.version 504 } 505 506 return nil 507 } 508 509 func (h *Header) SetVersion(v *refs.Version) { 510 h.version = v 511 } 512 513 func (h *Header) GetContainerID() *refs.ContainerID { 514 if h != nil { 515 return h.cid 516 } 517 518 return nil 519 } 520 521 func (h *Header) SetContainerID(v *refs.ContainerID) { 522 h.cid = v 523 } 524 525 func (h *Header) GetOwnerID() *refs.OwnerID { 526 if h != nil { 527 return h.ownerID 528 } 529 530 return nil 531 } 532 533 func (h *Header) SetOwnerID(v *refs.OwnerID) { 534 h.ownerID = v 535 } 536 537 func (h *Header) GetCreationEpoch() uint64 { 538 if h != nil { 539 return h.creatEpoch 540 } 541 542 return 0 543 } 544 545 func (h *Header) SetCreationEpoch(v uint64) { 546 h.creatEpoch = v 547 } 548 549 func (h *Header) GetPayloadLength() uint64 { 550 if h != nil { 551 return h.payloadLen 552 } 553 554 return 0 555 } 556 557 func (h *Header) SetPayloadLength(v uint64) { 558 h.payloadLen = v 559 } 560 561 func (h *Header) GetPayloadHash() *refs.Checksum { 562 if h != nil { 563 return h.payloadHash 564 } 565 566 return nil 567 } 568 569 func (h *Header) SetPayloadHash(v *refs.Checksum) { 570 h.payloadHash = v 571 } 572 573 func (h *Header) GetObjectType() Type { 574 if h != nil { 575 return h.typ 576 } 577 578 return TypeRegular 579 } 580 581 func (h *Header) SetObjectType(v Type) { 582 h.typ = v 583 } 584 585 func (h *Header) GetHomomorphicHash() *refs.Checksum { 586 if h != nil { 587 return h.homoHash 588 } 589 590 return nil 591 } 592 593 func (h *Header) SetHomomorphicHash(v *refs.Checksum) { 594 h.homoHash = v 595 } 596 597 func (h *Header) GetSessionToken() *session.Token { 598 if h != nil { 599 return h.sessionToken 600 } 601 602 return nil 603 } 604 605 func (h *Header) SetSessionToken(v *session.Token) { 606 h.sessionToken = v 607 } 608 609 func (h *Header) GetAttributes() []Attribute { 610 if h != nil { 611 return h.attr 612 } 613 614 return nil 615 } 616 617 func (h *Header) SetAttributes(v []Attribute) { 618 h.attr = v 619 } 620 621 func (h *Header) GetSplit() *SplitHeader { 622 if h != nil { 623 return h.split 624 } 625 626 return nil 627 } 628 629 func (h *Header) SetSplit(v *SplitHeader) { 630 h.split = v 631 } 632 633 func (h *HeaderWithSignature) GetHeader() *Header { 634 if h != nil { 635 return h.header 636 } 637 638 return nil 639 } 640 641 func (h *HeaderWithSignature) SetHeader(v *Header) { 642 h.header = v 643 } 644 645 func (h *HeaderWithSignature) GetSignature() *refs.Signature { 646 if h != nil { 647 return h.signature 648 } 649 650 return nil 651 } 652 653 func (h *HeaderWithSignature) SetSignature(v *refs.Signature) { 654 h.signature = v 655 } 656 657 func (h *HeaderWithSignature) getHeaderPart() {} 658 659 func (o *Object) GetObjectID() *refs.ObjectID { 660 if o != nil { 661 return o.objectID 662 } 663 664 return nil 665 } 666 667 func (o *Object) SetObjectID(v *refs.ObjectID) { 668 o.objectID = v 669 } 670 671 func (o *Object) GetSignature() *refs.Signature { 672 if o != nil { 673 return o.idSig 674 } 675 676 return nil 677 } 678 679 func (o *Object) SetSignature(v *refs.Signature) { 680 o.idSig = v 681 } 682 683 func (o *Object) GetHeader() *Header { 684 if o != nil { 685 return o.header 686 } 687 688 return nil 689 } 690 691 func (o *Object) SetHeader(v *Header) { 692 o.header = v 693 } 694 695 func (o *Object) GetPayload() []byte { 696 if o != nil { 697 return o.payload 698 } 699 700 return nil 701 } 702 703 func (o *Object) SetPayload(v []byte) { 704 o.payload = v 705 } 706 707 func (s *SplitInfo) GetSplitID() []byte { 708 if s != nil { 709 return s.splitID 710 } 711 712 return nil 713 } 714 715 func (s *SplitInfo) SetSplitID(v []byte) { 716 s.splitID = v 717 } 718 719 func (s *SplitInfo) GetLastPart() *refs.ObjectID { 720 if s != nil { 721 return s.lastPart 722 } 723 724 return nil 725 } 726 727 func (s *SplitInfo) SetLastPart(v *refs.ObjectID) { 728 s.lastPart = v 729 } 730 731 func (s *SplitInfo) GetLink() *refs.ObjectID { 732 if s != nil { 733 return s.link 734 } 735 736 return nil 737 } 738 739 func (s *SplitInfo) SetLink(v *refs.ObjectID) { 740 s.link = v 741 } 742 743 func (s *SplitInfo) getObjectPart() {} 744 745 func (s *SplitInfo) getHeaderPart() {} 746 747 func (s *SplitInfo) getRangePart() {} 748 749 func (r *GetRequestBody) GetAddress() *refs.Address { 750 if r != nil { 751 return r.addr 752 } 753 754 return nil 755 } 756 757 func (r *GetRequestBody) SetAddress(v *refs.Address) { 758 r.addr = v 759 } 760 761 func (r *GetRequestBody) GetRaw() bool { 762 if r != nil { 763 return r.raw 764 } 765 766 return false 767 } 768 769 func (r *GetRequestBody) SetRaw(v bool) { 770 r.raw = v 771 } 772 773 func (r *GetRequest) GetBody() *GetRequestBody { 774 if r != nil { 775 return r.body 776 } 777 778 return nil 779 } 780 781 func (r *GetRequest) SetBody(v *GetRequestBody) { 782 r.body = v 783 } 784 785 func (r *GetObjectPartInit) GetObjectID() *refs.ObjectID { 786 if r != nil { 787 return r.id 788 } 789 790 return nil 791 } 792 793 func (r *GetObjectPartInit) SetObjectID(v *refs.ObjectID) { 794 r.id = v 795 } 796 797 func (r *GetObjectPartInit) GetSignature() *refs.Signature { 798 if r != nil { 799 return r.sig 800 } 801 802 return nil 803 } 804 805 func (r *GetObjectPartInit) SetSignature(v *refs.Signature) { 806 r.sig = v 807 } 808 809 func (r *GetObjectPartInit) GetHeader() *Header { 810 if r != nil { 811 return r.hdr 812 } 813 814 return nil 815 } 816 817 func (r *GetObjectPartInit) SetHeader(v *Header) { 818 r.hdr = v 819 } 820 821 func (r *GetObjectPartInit) getObjectPart() {} 822 823 func (r *GetObjectPartChunk) GetChunk() []byte { 824 if r != nil { 825 return r.chunk 826 } 827 828 return nil 829 } 830 831 func (r *GetObjectPartChunk) SetChunk(v []byte) { 832 r.chunk = v 833 } 834 835 func (r *GetObjectPartChunk) getObjectPart() {} 836 837 func (r *GetResponseBody) GetObjectPart() GetObjectPart { 838 if r != nil { 839 return r.objPart 840 } 841 842 return nil 843 } 844 845 func (r *GetResponseBody) SetObjectPart(v GetObjectPart) { 846 r.objPart = v 847 } 848 849 func (r *GetResponse) GetBody() *GetResponseBody { 850 if r != nil { 851 return r.body 852 } 853 854 return nil 855 } 856 857 func (r *GetResponse) SetBody(v *GetResponseBody) { 858 r.body = v 859 } 860 861 func (r *PutObjectPartInit) GetObjectID() *refs.ObjectID { 862 if r != nil { 863 return r.id 864 } 865 866 return nil 867 } 868 869 func (r *PutObjectPartInit) SetObjectID(v *refs.ObjectID) { 870 r.id = v 871 } 872 873 func (r *PutObjectPartInit) GetSignature() *refs.Signature { 874 if r != nil { 875 return r.sig 876 } 877 878 return nil 879 } 880 881 func (r *PutObjectPartInit) SetSignature(v *refs.Signature) { 882 r.sig = v 883 } 884 885 func (r *PutObjectPartInit) GetHeader() *Header { 886 if r != nil { 887 return r.hdr 888 } 889 890 return nil 891 } 892 893 func (r *PutObjectPartInit) SetHeader(v *Header) { 894 r.hdr = v 895 } 896 897 func (r *PutObjectPartInit) GetCopiesNumber() uint32 { 898 if r != nil { 899 return r.copyNum 900 } 901 902 return 0 903 } 904 905 func (r *PutObjectPartInit) SetCopiesNumber(v uint32) { 906 r.copyNum = v 907 } 908 909 func (r *PutObjectPartInit) putObjectPart() {} 910 911 func (r *PutObjectPartChunk) GetChunk() []byte { 912 if r != nil { 913 return r.chunk 914 } 915 916 return nil 917 } 918 919 func (r *PutObjectPartChunk) SetChunk(v []byte) { 920 r.chunk = v 921 } 922 923 func (r *PutObjectPartChunk) putObjectPart() {} 924 925 func (r *PutRequestBody) GetObjectPart() PutObjectPart { 926 if r != nil { 927 return r.objPart 928 } 929 930 return nil 931 } 932 933 func (r *PutRequestBody) SetObjectPart(v PutObjectPart) { 934 r.objPart = v 935 } 936 937 func (r *PutRequest) GetBody() *PutRequestBody { 938 if r != nil { 939 return r.body 940 } 941 942 return nil 943 } 944 945 func (r *PutRequest) SetBody(v *PutRequestBody) { 946 r.body = v 947 } 948 949 func (r *PutResponseBody) GetObjectID() *refs.ObjectID { 950 if r != nil { 951 return r.id 952 } 953 954 return nil 955 } 956 957 func (r *PutResponseBody) SetObjectID(v *refs.ObjectID) { 958 r.id = v 959 } 960 961 func (r *PutResponse) GetBody() *PutResponseBody { 962 if r != nil { 963 return r.body 964 } 965 966 return nil 967 } 968 969 func (r *PutResponse) SetBody(v *PutResponseBody) { 970 r.body = v 971 } 972 973 func (r *DeleteRequestBody) GetAddress() *refs.Address { 974 if r != nil { 975 return r.addr 976 } 977 978 return nil 979 } 980 981 func (r *DeleteRequestBody) SetAddress(v *refs.Address) { 982 r.addr = v 983 } 984 985 func (r *DeleteRequest) GetBody() *DeleteRequestBody { 986 if r != nil { 987 return r.body 988 } 989 990 return nil 991 } 992 993 func (r *DeleteRequest) SetBody(v *DeleteRequestBody) { 994 r.body = v 995 } 996 997 // GetTombstone returns tombstone address. 998 func (r *DeleteResponseBody) GetTombstone() *refs.Address { 999 if r != nil { 1000 return r.tombstone 1001 } 1002 1003 return nil 1004 } 1005 1006 // SetTombstone sets tombstone address. 1007 func (r *DeleteResponseBody) SetTombstone(v *refs.Address) { 1008 r.tombstone = v 1009 } 1010 1011 func (r *DeleteResponse) GetBody() *DeleteResponseBody { 1012 if r != nil { 1013 return r.body 1014 } 1015 1016 return nil 1017 } 1018 1019 func (r *DeleteResponse) SetBody(v *DeleteResponseBody) { 1020 r.body = v 1021 } 1022 1023 func (r *HeadRequestBody) GetAddress() *refs.Address { 1024 if r != nil { 1025 return r.addr 1026 } 1027 1028 return nil 1029 } 1030 1031 func (r *HeadRequestBody) SetAddress(v *refs.Address) { 1032 r.addr = v 1033 } 1034 1035 func (r *HeadRequestBody) GetMainOnly() bool { 1036 if r != nil { 1037 return r.mainOnly 1038 } 1039 1040 return false 1041 } 1042 1043 func (r *HeadRequestBody) SetMainOnly(v bool) { 1044 r.mainOnly = v 1045 } 1046 1047 func (r *HeadRequestBody) GetRaw() bool { 1048 if r != nil { 1049 return r.raw 1050 } 1051 1052 return false 1053 } 1054 1055 func (r *HeadRequestBody) SetRaw(v bool) { 1056 r.raw = v 1057 } 1058 1059 func (r *HeadRequest) GetBody() *HeadRequestBody { 1060 if r != nil { 1061 return r.body 1062 } 1063 1064 return nil 1065 } 1066 1067 func (r *HeadRequest) SetBody(v *HeadRequestBody) { 1068 r.body = v 1069 } 1070 1071 func (r *HeadResponseBody) GetHeaderPart() GetHeaderPart { 1072 if r != nil { 1073 return r.hdrPart 1074 } 1075 1076 return nil 1077 } 1078 1079 func (r *HeadResponseBody) SetHeaderPart(v GetHeaderPart) { 1080 r.hdrPart = v 1081 } 1082 1083 func (r *HeadResponse) GetBody() *HeadResponseBody { 1084 if r != nil { 1085 return r.body 1086 } 1087 1088 return nil 1089 } 1090 1091 func (r *HeadResponse) SetBody(v *HeadResponseBody) { 1092 r.body = v 1093 } 1094 1095 func (f *SearchFilter) GetMatchType() MatchType { 1096 if f != nil { 1097 return f.matchType 1098 } 1099 1100 return MatchUnknown 1101 } 1102 1103 func (f *SearchFilter) SetMatchType(v MatchType) { 1104 f.matchType = v 1105 } 1106 1107 func (f *SearchFilter) GetKey() string { 1108 if f != nil { 1109 return f.key 1110 } 1111 1112 return "" 1113 } 1114 1115 func (f *SearchFilter) SetKey(v string) { 1116 f.key = v 1117 } 1118 1119 func (f *SearchFilter) GetValue() string { 1120 if f != nil { 1121 return f.val 1122 } 1123 1124 return "" 1125 } 1126 1127 func (f *SearchFilter) SetValue(v string) { 1128 f.val = v 1129 } 1130 1131 func (r *SearchRequestBody) GetContainerID() *refs.ContainerID { 1132 if r != nil { 1133 return r.cid 1134 } 1135 1136 return nil 1137 } 1138 1139 func (r *SearchRequestBody) SetContainerID(v *refs.ContainerID) { 1140 r.cid = v 1141 } 1142 1143 func (r *SearchRequestBody) GetVersion() uint32 { 1144 if r != nil { 1145 return r.version 1146 } 1147 1148 return 0 1149 } 1150 1151 func (r *SearchRequestBody) SetVersion(v uint32) { 1152 r.version = v 1153 } 1154 1155 func (r *SearchRequestBody) GetFilters() []SearchFilter { 1156 if r != nil { 1157 return r.filters 1158 } 1159 1160 return nil 1161 } 1162 1163 func (r *SearchRequestBody) SetFilters(v []SearchFilter) { 1164 r.filters = v 1165 } 1166 1167 func (r *SearchRequest) GetBody() *SearchRequestBody { 1168 if r != nil { 1169 return r.body 1170 } 1171 1172 return nil 1173 } 1174 1175 func (r *SearchRequest) SetBody(v *SearchRequestBody) { 1176 r.body = v 1177 } 1178 1179 func (r *SearchResponseBody) GetIDList() []refs.ObjectID { 1180 if r != nil { 1181 return r.idList 1182 } 1183 1184 return nil 1185 } 1186 1187 func (r *SearchResponseBody) SetIDList(v []refs.ObjectID) { 1188 r.idList = v 1189 } 1190 1191 func (r *SearchResponse) GetBody() *SearchResponseBody { 1192 if r != nil { 1193 return r.body 1194 } 1195 1196 return nil 1197 } 1198 1199 func (r *SearchResponse) SetBody(v *SearchResponseBody) { 1200 r.body = v 1201 } 1202 1203 func (r *Range) GetOffset() uint64 { 1204 if r != nil { 1205 return r.off 1206 } 1207 1208 return 0 1209 } 1210 1211 func (r *Range) SetOffset(v uint64) { 1212 r.off = v 1213 } 1214 1215 func (r *Range) GetLength() uint64 { 1216 if r != nil { 1217 return r.len 1218 } 1219 1220 return 0 1221 } 1222 1223 func (r *Range) SetLength(v uint64) { 1224 r.len = v 1225 } 1226 1227 func (r *GetRangeRequestBody) GetAddress() *refs.Address { 1228 if r != nil { 1229 return r.addr 1230 } 1231 1232 return nil 1233 } 1234 1235 func (r *GetRangeRequestBody) SetAddress(v *refs.Address) { 1236 r.addr = v 1237 } 1238 1239 func (r *GetRangeRequestBody) GetRange() *Range { 1240 if r != nil { 1241 return r.rng 1242 } 1243 1244 return nil 1245 } 1246 1247 func (r *GetRangeRequestBody) SetRange(v *Range) { 1248 r.rng = v 1249 } 1250 1251 func (r *GetRangeRequestBody) GetRaw() bool { 1252 if r != nil { 1253 return r.raw 1254 } 1255 1256 return false 1257 } 1258 1259 func (r *GetRangeRequestBody) SetRaw(v bool) { 1260 r.raw = v 1261 } 1262 1263 func (r *GetRangeRequest) GetBody() *GetRangeRequestBody { 1264 if r != nil { 1265 return r.body 1266 } 1267 1268 return nil 1269 } 1270 1271 func (r *GetRangeRequest) SetBody(v *GetRangeRequestBody) { 1272 r.body = v 1273 } 1274 1275 func (r *GetRangePartChunk) GetChunk() []byte { 1276 if r != nil { 1277 return r.chunk 1278 } 1279 1280 return nil 1281 } 1282 1283 func (r *GetRangePartChunk) SetChunk(v []byte) { 1284 r.chunk = v 1285 } 1286 1287 func (r *GetRangePartChunk) getRangePart() {} 1288 1289 func (r *GetRangeResponseBody) GetRangePart() GetRangePart { 1290 if r != nil { 1291 return r.rngPart 1292 } 1293 1294 return nil 1295 } 1296 1297 func (r *GetRangeResponseBody) SetRangePart(v GetRangePart) { 1298 r.rngPart = v 1299 } 1300 1301 func (r *GetRangeResponse) GetBody() *GetRangeResponseBody { 1302 if r != nil { 1303 return r.body 1304 } 1305 1306 return nil 1307 } 1308 1309 func (r *GetRangeResponse) SetBody(v *GetRangeResponseBody) { 1310 r.body = v 1311 } 1312 1313 func (r *GetRangeHashRequestBody) GetAddress() *refs.Address { 1314 if r != nil { 1315 return r.addr 1316 } 1317 1318 return nil 1319 } 1320 1321 func (r *GetRangeHashRequestBody) SetAddress(v *refs.Address) { 1322 r.addr = v 1323 } 1324 1325 func (r *GetRangeHashRequestBody) GetRanges() []Range { 1326 if r != nil { 1327 return r.rngs 1328 } 1329 1330 return nil 1331 } 1332 1333 func (r *GetRangeHashRequestBody) SetRanges(v []Range) { 1334 r.rngs = v 1335 } 1336 1337 func (r *GetRangeHashRequestBody) GetSalt() []byte { 1338 if r != nil { 1339 return r.salt 1340 } 1341 1342 return nil 1343 } 1344 1345 func (r *GetRangeHashRequestBody) SetSalt(v []byte) { 1346 r.salt = v 1347 } 1348 1349 func (r *GetRangeHashRequestBody) GetType() refs.ChecksumType { 1350 if r != nil { 1351 return r.typ 1352 } 1353 1354 return refs.UnknownChecksum 1355 } 1356 1357 func (r *GetRangeHashRequestBody) SetType(v refs.ChecksumType) { 1358 r.typ = v 1359 } 1360 1361 func (r *GetRangeHashRequest) GetBody() *GetRangeHashRequestBody { 1362 if r != nil { 1363 return r.body 1364 } 1365 1366 return nil 1367 } 1368 1369 func (r *GetRangeHashRequest) SetBody(v *GetRangeHashRequestBody) { 1370 r.body = v 1371 } 1372 1373 func (r *GetRangeHashResponseBody) GetType() refs.ChecksumType { 1374 if r != nil { 1375 return r.typ 1376 } 1377 1378 return refs.UnknownChecksum 1379 } 1380 1381 func (r *GetRangeHashResponseBody) SetType(v refs.ChecksumType) { 1382 r.typ = v 1383 } 1384 1385 func (r *GetRangeHashResponseBody) GetHashList() [][]byte { 1386 if r != nil { 1387 return r.hashList 1388 } 1389 1390 return nil 1391 } 1392 1393 func (r *GetRangeHashResponseBody) SetHashList(v [][]byte) { 1394 r.hashList = v 1395 } 1396 1397 func (r *GetRangeHashResponse) GetBody() *GetRangeHashResponseBody { 1398 if r != nil { 1399 return r.body 1400 } 1401 1402 return nil 1403 } 1404 1405 func (r *GetRangeHashResponse) SetBody(v *GetRangeHashResponseBody) { 1406 r.body = v 1407 }