github.com/minio/minio@v0.0.0-20240328213742-3f72439b8a27/cmd/xl-storage-format-v2_gen.go (about) 1 package cmd 2 3 // Code generated by github.com/tinylib/msgp DO NOT EDIT. 4 5 import ( 6 "github.com/tinylib/msgp/msgp" 7 ) 8 9 // DecodeMsg implements msgp.Decodable 10 func (z *ChecksumAlgo) DecodeMsg(dc *msgp.Reader) (err error) { 11 { 12 var zb0001 uint8 13 zb0001, err = dc.ReadUint8() 14 if err != nil { 15 err = msgp.WrapError(err) 16 return 17 } 18 (*z) = ChecksumAlgo(zb0001) 19 } 20 return 21 } 22 23 // EncodeMsg implements msgp.Encodable 24 func (z ChecksumAlgo) EncodeMsg(en *msgp.Writer) (err error) { 25 err = en.WriteUint8(uint8(z)) 26 if err != nil { 27 err = msgp.WrapError(err) 28 return 29 } 30 return 31 } 32 33 // MarshalMsg implements msgp.Marshaler 34 func (z ChecksumAlgo) MarshalMsg(b []byte) (o []byte, err error) { 35 o = msgp.Require(b, z.Msgsize()) 36 o = msgp.AppendUint8(o, uint8(z)) 37 return 38 } 39 40 // UnmarshalMsg implements msgp.Unmarshaler 41 func (z *ChecksumAlgo) UnmarshalMsg(bts []byte) (o []byte, err error) { 42 { 43 var zb0001 uint8 44 zb0001, bts, err = msgp.ReadUint8Bytes(bts) 45 if err != nil { 46 err = msgp.WrapError(err) 47 return 48 } 49 (*z) = ChecksumAlgo(zb0001) 50 } 51 o = bts 52 return 53 } 54 55 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 56 func (z ChecksumAlgo) Msgsize() (s int) { 57 s = msgp.Uint8Size 58 return 59 } 60 61 // DecodeMsg implements msgp.Decodable 62 func (z *ErasureAlgo) DecodeMsg(dc *msgp.Reader) (err error) { 63 { 64 var zb0001 uint8 65 zb0001, err = dc.ReadUint8() 66 if err != nil { 67 err = msgp.WrapError(err) 68 return 69 } 70 (*z) = ErasureAlgo(zb0001) 71 } 72 return 73 } 74 75 // EncodeMsg implements msgp.Encodable 76 func (z ErasureAlgo) EncodeMsg(en *msgp.Writer) (err error) { 77 err = en.WriteUint8(uint8(z)) 78 if err != nil { 79 err = msgp.WrapError(err) 80 return 81 } 82 return 83 } 84 85 // MarshalMsg implements msgp.Marshaler 86 func (z ErasureAlgo) MarshalMsg(b []byte) (o []byte, err error) { 87 o = msgp.Require(b, z.Msgsize()) 88 o = msgp.AppendUint8(o, uint8(z)) 89 return 90 } 91 92 // UnmarshalMsg implements msgp.Unmarshaler 93 func (z *ErasureAlgo) UnmarshalMsg(bts []byte) (o []byte, err error) { 94 { 95 var zb0001 uint8 96 zb0001, bts, err = msgp.ReadUint8Bytes(bts) 97 if err != nil { 98 err = msgp.WrapError(err) 99 return 100 } 101 (*z) = ErasureAlgo(zb0001) 102 } 103 o = bts 104 return 105 } 106 107 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 108 func (z ErasureAlgo) Msgsize() (s int) { 109 s = msgp.Uint8Size 110 return 111 } 112 113 // DecodeMsg implements msgp.Decodable 114 func (z *VersionType) DecodeMsg(dc *msgp.Reader) (err error) { 115 { 116 var zb0001 uint8 117 zb0001, err = dc.ReadUint8() 118 if err != nil { 119 err = msgp.WrapError(err) 120 return 121 } 122 (*z) = VersionType(zb0001) 123 } 124 return 125 } 126 127 // EncodeMsg implements msgp.Encodable 128 func (z VersionType) EncodeMsg(en *msgp.Writer) (err error) { 129 err = en.WriteUint8(uint8(z)) 130 if err != nil { 131 err = msgp.WrapError(err) 132 return 133 } 134 return 135 } 136 137 // MarshalMsg implements msgp.Marshaler 138 func (z VersionType) MarshalMsg(b []byte) (o []byte, err error) { 139 o = msgp.Require(b, z.Msgsize()) 140 o = msgp.AppendUint8(o, uint8(z)) 141 return 142 } 143 144 // UnmarshalMsg implements msgp.Unmarshaler 145 func (z *VersionType) UnmarshalMsg(bts []byte) (o []byte, err error) { 146 { 147 var zb0001 uint8 148 zb0001, bts, err = msgp.ReadUint8Bytes(bts) 149 if err != nil { 150 err = msgp.WrapError(err) 151 return 152 } 153 (*z) = VersionType(zb0001) 154 } 155 o = bts 156 return 157 } 158 159 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 160 func (z VersionType) Msgsize() (s int) { 161 s = msgp.Uint8Size 162 return 163 } 164 165 // DecodeMsg implements msgp.Decodable 166 func (z *xlFlags) DecodeMsg(dc *msgp.Reader) (err error) { 167 { 168 var zb0001 uint8 169 zb0001, err = dc.ReadUint8() 170 if err != nil { 171 err = msgp.WrapError(err) 172 return 173 } 174 (*z) = xlFlags(zb0001) 175 } 176 return 177 } 178 179 // EncodeMsg implements msgp.Encodable 180 func (z xlFlags) EncodeMsg(en *msgp.Writer) (err error) { 181 err = en.WriteUint8(uint8(z)) 182 if err != nil { 183 err = msgp.WrapError(err) 184 return 185 } 186 return 187 } 188 189 // MarshalMsg implements msgp.Marshaler 190 func (z xlFlags) MarshalMsg(b []byte) (o []byte, err error) { 191 o = msgp.Require(b, z.Msgsize()) 192 o = msgp.AppendUint8(o, uint8(z)) 193 return 194 } 195 196 // UnmarshalMsg implements msgp.Unmarshaler 197 func (z *xlFlags) UnmarshalMsg(bts []byte) (o []byte, err error) { 198 { 199 var zb0001 uint8 200 zb0001, bts, err = msgp.ReadUint8Bytes(bts) 201 if err != nil { 202 err = msgp.WrapError(err) 203 return 204 } 205 (*z) = xlFlags(zb0001) 206 } 207 o = bts 208 return 209 } 210 211 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 212 func (z xlFlags) Msgsize() (s int) { 213 s = msgp.Uint8Size 214 return 215 } 216 217 // DecodeMsg implements msgp.Decodable 218 func (z *xlMetaBuf) DecodeMsg(dc *msgp.Reader) (err error) { 219 { 220 var zb0001 []byte 221 zb0001, err = dc.ReadBytes([]byte((*z))) 222 if err != nil { 223 err = msgp.WrapError(err) 224 return 225 } 226 (*z) = xlMetaBuf(zb0001) 227 } 228 return 229 } 230 231 // EncodeMsg implements msgp.Encodable 232 func (z xlMetaBuf) EncodeMsg(en *msgp.Writer) (err error) { 233 err = en.WriteBytes([]byte(z)) 234 if err != nil { 235 err = msgp.WrapError(err) 236 return 237 } 238 return 239 } 240 241 // MarshalMsg implements msgp.Marshaler 242 func (z xlMetaBuf) MarshalMsg(b []byte) (o []byte, err error) { 243 o = msgp.Require(b, z.Msgsize()) 244 o = msgp.AppendBytes(o, []byte(z)) 245 return 246 } 247 248 // UnmarshalMsg implements msgp.Unmarshaler 249 func (z *xlMetaBuf) UnmarshalMsg(bts []byte) (o []byte, err error) { 250 { 251 var zb0001 []byte 252 zb0001, bts, err = msgp.ReadBytesBytes(bts, []byte((*z))) 253 if err != nil { 254 err = msgp.WrapError(err) 255 return 256 } 257 (*z) = xlMetaBuf(zb0001) 258 } 259 o = bts 260 return 261 } 262 263 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 264 func (z xlMetaBuf) Msgsize() (s int) { 265 s = msgp.BytesPrefixSize + len([]byte(z)) 266 return 267 } 268 269 // DecodeMsg implements msgp.Decodable 270 func (z *xlMetaDataDirDecoder) DecodeMsg(dc *msgp.Reader) (err error) { 271 var field []byte 272 _ = field 273 var zb0001 uint32 274 zb0001, err = dc.ReadMapHeader() 275 if err != nil { 276 err = msgp.WrapError(err) 277 return 278 } 279 for zb0001 > 0 { 280 zb0001-- 281 field, err = dc.ReadMapKeyPtr() 282 if err != nil { 283 err = msgp.WrapError(err) 284 return 285 } 286 switch msgp.UnsafeString(field) { 287 case "V2Obj": 288 if dc.IsNil() { 289 err = dc.ReadNil() 290 if err != nil { 291 err = msgp.WrapError(err, "ObjectV2") 292 return 293 } 294 z.ObjectV2 = nil 295 } else { 296 if z.ObjectV2 == nil { 297 z.ObjectV2 = new(struct { 298 DataDir [16]byte `msg:"DDir"` 299 }) 300 } 301 var zb0002 uint32 302 zb0002, err = dc.ReadMapHeader() 303 if err != nil { 304 err = msgp.WrapError(err, "ObjectV2") 305 return 306 } 307 for zb0002 > 0 { 308 zb0002-- 309 field, err = dc.ReadMapKeyPtr() 310 if err != nil { 311 err = msgp.WrapError(err, "ObjectV2") 312 return 313 } 314 switch msgp.UnsafeString(field) { 315 case "DDir": 316 err = dc.ReadExactBytes((z.ObjectV2.DataDir)[:]) 317 if err != nil { 318 err = msgp.WrapError(err, "ObjectV2", "DataDir") 319 return 320 } 321 default: 322 err = dc.Skip() 323 if err != nil { 324 err = msgp.WrapError(err, "ObjectV2") 325 return 326 } 327 } 328 } 329 } 330 default: 331 err = dc.Skip() 332 if err != nil { 333 err = msgp.WrapError(err) 334 return 335 } 336 } 337 } 338 return 339 } 340 341 // EncodeMsg implements msgp.Encodable 342 func (z *xlMetaDataDirDecoder) EncodeMsg(en *msgp.Writer) (err error) { 343 // check for omitted fields 344 zb0001Len := uint32(1) 345 var zb0001Mask uint8 /* 1 bits */ 346 _ = zb0001Mask 347 if z.ObjectV2 == nil { 348 zb0001Len-- 349 zb0001Mask |= 0x1 350 } 351 // variable map header, size zb0001Len 352 err = en.Append(0x80 | uint8(zb0001Len)) 353 if err != nil { 354 return 355 } 356 if zb0001Len == 0 { 357 return 358 } 359 if (zb0001Mask & 0x1) == 0 { // if not omitted 360 // write "V2Obj" 361 err = en.Append(0xa5, 0x56, 0x32, 0x4f, 0x62, 0x6a) 362 if err != nil { 363 return 364 } 365 if z.ObjectV2 == nil { 366 err = en.WriteNil() 367 if err != nil { 368 return 369 } 370 } else { 371 // map header, size 1 372 // write "DDir" 373 err = en.Append(0x81, 0xa4, 0x44, 0x44, 0x69, 0x72) 374 if err != nil { 375 return 376 } 377 err = en.WriteBytes((z.ObjectV2.DataDir)[:]) 378 if err != nil { 379 err = msgp.WrapError(err, "ObjectV2", "DataDir") 380 return 381 } 382 } 383 } 384 return 385 } 386 387 // MarshalMsg implements msgp.Marshaler 388 func (z *xlMetaDataDirDecoder) MarshalMsg(b []byte) (o []byte, err error) { 389 o = msgp.Require(b, z.Msgsize()) 390 // check for omitted fields 391 zb0001Len := uint32(1) 392 var zb0001Mask uint8 /* 1 bits */ 393 _ = zb0001Mask 394 if z.ObjectV2 == nil { 395 zb0001Len-- 396 zb0001Mask |= 0x1 397 } 398 // variable map header, size zb0001Len 399 o = append(o, 0x80|uint8(zb0001Len)) 400 if zb0001Len == 0 { 401 return 402 } 403 if (zb0001Mask & 0x1) == 0 { // if not omitted 404 // string "V2Obj" 405 o = append(o, 0xa5, 0x56, 0x32, 0x4f, 0x62, 0x6a) 406 if z.ObjectV2 == nil { 407 o = msgp.AppendNil(o) 408 } else { 409 // map header, size 1 410 // string "DDir" 411 o = append(o, 0x81, 0xa4, 0x44, 0x44, 0x69, 0x72) 412 o = msgp.AppendBytes(o, (z.ObjectV2.DataDir)[:]) 413 } 414 } 415 return 416 } 417 418 // UnmarshalMsg implements msgp.Unmarshaler 419 func (z *xlMetaDataDirDecoder) UnmarshalMsg(bts []byte) (o []byte, err error) { 420 var field []byte 421 _ = field 422 var zb0001 uint32 423 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 424 if err != nil { 425 err = msgp.WrapError(err) 426 return 427 } 428 for zb0001 > 0 { 429 zb0001-- 430 field, bts, err = msgp.ReadMapKeyZC(bts) 431 if err != nil { 432 err = msgp.WrapError(err) 433 return 434 } 435 switch msgp.UnsafeString(field) { 436 case "V2Obj": 437 if msgp.IsNil(bts) { 438 bts, err = msgp.ReadNilBytes(bts) 439 if err != nil { 440 return 441 } 442 z.ObjectV2 = nil 443 } else { 444 if z.ObjectV2 == nil { 445 z.ObjectV2 = new(struct { 446 DataDir [16]byte `msg:"DDir"` 447 }) 448 } 449 var zb0002 uint32 450 zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) 451 if err != nil { 452 err = msgp.WrapError(err, "ObjectV2") 453 return 454 } 455 for zb0002 > 0 { 456 zb0002-- 457 field, bts, err = msgp.ReadMapKeyZC(bts) 458 if err != nil { 459 err = msgp.WrapError(err, "ObjectV2") 460 return 461 } 462 switch msgp.UnsafeString(field) { 463 case "DDir": 464 bts, err = msgp.ReadExactBytes(bts, (z.ObjectV2.DataDir)[:]) 465 if err != nil { 466 err = msgp.WrapError(err, "ObjectV2", "DataDir") 467 return 468 } 469 default: 470 bts, err = msgp.Skip(bts) 471 if err != nil { 472 err = msgp.WrapError(err, "ObjectV2") 473 return 474 } 475 } 476 } 477 } 478 default: 479 bts, err = msgp.Skip(bts) 480 if err != nil { 481 err = msgp.WrapError(err) 482 return 483 } 484 } 485 } 486 o = bts 487 return 488 } 489 490 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 491 func (z *xlMetaDataDirDecoder) Msgsize() (s int) { 492 s = 1 + 6 493 if z.ObjectV2 == nil { 494 s += msgp.NilSize 495 } else { 496 s += 1 + 5 + msgp.ArrayHeaderSize + (16 * (msgp.ByteSize)) 497 } 498 return 499 } 500 501 // DecodeMsg implements msgp.Decodable 502 func (z *xlMetaV2DeleteMarker) DecodeMsg(dc *msgp.Reader) (err error) { 503 var field []byte 504 _ = field 505 var zb0001 uint32 506 zb0001, err = dc.ReadMapHeader() 507 if err != nil { 508 err = msgp.WrapError(err) 509 return 510 } 511 for zb0001 > 0 { 512 zb0001-- 513 field, err = dc.ReadMapKeyPtr() 514 if err != nil { 515 err = msgp.WrapError(err) 516 return 517 } 518 switch msgp.UnsafeString(field) { 519 case "ID": 520 err = dc.ReadExactBytes((z.VersionID)[:]) 521 if err != nil { 522 err = msgp.WrapError(err, "VersionID") 523 return 524 } 525 case "MTime": 526 z.ModTime, err = dc.ReadInt64() 527 if err != nil { 528 err = msgp.WrapError(err, "ModTime") 529 return 530 } 531 case "MetaSys": 532 var zb0002 uint32 533 zb0002, err = dc.ReadMapHeader() 534 if err != nil { 535 err = msgp.WrapError(err, "MetaSys") 536 return 537 } 538 if z.MetaSys == nil { 539 z.MetaSys = make(map[string][]byte, zb0002) 540 } else if len(z.MetaSys) > 0 { 541 for key := range z.MetaSys { 542 delete(z.MetaSys, key) 543 } 544 } 545 for zb0002 > 0 { 546 zb0002-- 547 var za0002 string 548 var za0003 []byte 549 za0002, err = dc.ReadString() 550 if err != nil { 551 err = msgp.WrapError(err, "MetaSys") 552 return 553 } 554 za0003, err = dc.ReadBytes(za0003) 555 if err != nil { 556 err = msgp.WrapError(err, "MetaSys", za0002) 557 return 558 } 559 z.MetaSys[za0002] = za0003 560 } 561 default: 562 err = dc.Skip() 563 if err != nil { 564 err = msgp.WrapError(err) 565 return 566 } 567 } 568 } 569 return 570 } 571 572 // EncodeMsg implements msgp.Encodable 573 func (z *xlMetaV2DeleteMarker) EncodeMsg(en *msgp.Writer) (err error) { 574 // check for omitted fields 575 zb0001Len := uint32(3) 576 var zb0001Mask uint8 /* 3 bits */ 577 _ = zb0001Mask 578 if z.MetaSys == nil { 579 zb0001Len-- 580 zb0001Mask |= 0x4 581 } 582 // variable map header, size zb0001Len 583 err = en.Append(0x80 | uint8(zb0001Len)) 584 if err != nil { 585 return 586 } 587 if zb0001Len == 0 { 588 return 589 } 590 // write "ID" 591 err = en.Append(0xa2, 0x49, 0x44) 592 if err != nil { 593 return 594 } 595 err = en.WriteBytes((z.VersionID)[:]) 596 if err != nil { 597 err = msgp.WrapError(err, "VersionID") 598 return 599 } 600 // write "MTime" 601 err = en.Append(0xa5, 0x4d, 0x54, 0x69, 0x6d, 0x65) 602 if err != nil { 603 return 604 } 605 err = en.WriteInt64(z.ModTime) 606 if err != nil { 607 err = msgp.WrapError(err, "ModTime") 608 return 609 } 610 if (zb0001Mask & 0x4) == 0 { // if not omitted 611 // write "MetaSys" 612 err = en.Append(0xa7, 0x4d, 0x65, 0x74, 0x61, 0x53, 0x79, 0x73) 613 if err != nil { 614 return 615 } 616 err = en.WriteMapHeader(uint32(len(z.MetaSys))) 617 if err != nil { 618 err = msgp.WrapError(err, "MetaSys") 619 return 620 } 621 for za0002, za0003 := range z.MetaSys { 622 err = en.WriteString(za0002) 623 if err != nil { 624 err = msgp.WrapError(err, "MetaSys") 625 return 626 } 627 err = en.WriteBytes(za0003) 628 if err != nil { 629 err = msgp.WrapError(err, "MetaSys", za0002) 630 return 631 } 632 } 633 } 634 return 635 } 636 637 // MarshalMsg implements msgp.Marshaler 638 func (z *xlMetaV2DeleteMarker) MarshalMsg(b []byte) (o []byte, err error) { 639 o = msgp.Require(b, z.Msgsize()) 640 // check for omitted fields 641 zb0001Len := uint32(3) 642 var zb0001Mask uint8 /* 3 bits */ 643 _ = zb0001Mask 644 if z.MetaSys == nil { 645 zb0001Len-- 646 zb0001Mask |= 0x4 647 } 648 // variable map header, size zb0001Len 649 o = append(o, 0x80|uint8(zb0001Len)) 650 if zb0001Len == 0 { 651 return 652 } 653 // string "ID" 654 o = append(o, 0xa2, 0x49, 0x44) 655 o = msgp.AppendBytes(o, (z.VersionID)[:]) 656 // string "MTime" 657 o = append(o, 0xa5, 0x4d, 0x54, 0x69, 0x6d, 0x65) 658 o = msgp.AppendInt64(o, z.ModTime) 659 if (zb0001Mask & 0x4) == 0 { // if not omitted 660 // string "MetaSys" 661 o = append(o, 0xa7, 0x4d, 0x65, 0x74, 0x61, 0x53, 0x79, 0x73) 662 o = msgp.AppendMapHeader(o, uint32(len(z.MetaSys))) 663 for za0002, za0003 := range z.MetaSys { 664 o = msgp.AppendString(o, za0002) 665 o = msgp.AppendBytes(o, za0003) 666 } 667 } 668 return 669 } 670 671 // UnmarshalMsg implements msgp.Unmarshaler 672 func (z *xlMetaV2DeleteMarker) UnmarshalMsg(bts []byte) (o []byte, err error) { 673 var field []byte 674 _ = field 675 var zb0001 uint32 676 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 677 if err != nil { 678 err = msgp.WrapError(err) 679 return 680 } 681 for zb0001 > 0 { 682 zb0001-- 683 field, bts, err = msgp.ReadMapKeyZC(bts) 684 if err != nil { 685 err = msgp.WrapError(err) 686 return 687 } 688 switch msgp.UnsafeString(field) { 689 case "ID": 690 bts, err = msgp.ReadExactBytes(bts, (z.VersionID)[:]) 691 if err != nil { 692 err = msgp.WrapError(err, "VersionID") 693 return 694 } 695 case "MTime": 696 z.ModTime, bts, err = msgp.ReadInt64Bytes(bts) 697 if err != nil { 698 err = msgp.WrapError(err, "ModTime") 699 return 700 } 701 case "MetaSys": 702 var zb0002 uint32 703 zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) 704 if err != nil { 705 err = msgp.WrapError(err, "MetaSys") 706 return 707 } 708 if z.MetaSys == nil { 709 z.MetaSys = make(map[string][]byte, zb0002) 710 } else if len(z.MetaSys) > 0 { 711 for key := range z.MetaSys { 712 delete(z.MetaSys, key) 713 } 714 } 715 for zb0002 > 0 { 716 var za0002 string 717 var za0003 []byte 718 zb0002-- 719 za0002, bts, err = msgp.ReadStringBytes(bts) 720 if err != nil { 721 err = msgp.WrapError(err, "MetaSys") 722 return 723 } 724 za0003, bts, err = msgp.ReadBytesBytes(bts, za0003) 725 if err != nil { 726 err = msgp.WrapError(err, "MetaSys", za0002) 727 return 728 } 729 z.MetaSys[za0002] = za0003 730 } 731 default: 732 bts, err = msgp.Skip(bts) 733 if err != nil { 734 err = msgp.WrapError(err) 735 return 736 } 737 } 738 } 739 o = bts 740 return 741 } 742 743 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 744 func (z *xlMetaV2DeleteMarker) Msgsize() (s int) { 745 s = 1 + 3 + msgp.ArrayHeaderSize + (16 * (msgp.ByteSize)) + 6 + msgp.Int64Size + 8 + msgp.MapHeaderSize 746 if z.MetaSys != nil { 747 for za0002, za0003 := range z.MetaSys { 748 _ = za0003 749 s += msgp.StringPrefixSize + len(za0002) + msgp.BytesPrefixSize + len(za0003) 750 } 751 } 752 return 753 } 754 755 // DecodeMsg implements msgp.Decodable 756 func (z *xlMetaV2Object) DecodeMsg(dc *msgp.Reader) (err error) { 757 var field []byte 758 _ = field 759 var zb0001 uint32 760 zb0001, err = dc.ReadMapHeader() 761 if err != nil { 762 err = msgp.WrapError(err) 763 return 764 } 765 for zb0001 > 0 { 766 zb0001-- 767 field, err = dc.ReadMapKeyPtr() 768 if err != nil { 769 err = msgp.WrapError(err) 770 return 771 } 772 switch msgp.UnsafeString(field) { 773 case "ID": 774 err = dc.ReadExactBytes((z.VersionID)[:]) 775 if err != nil { 776 err = msgp.WrapError(err, "VersionID") 777 return 778 } 779 case "DDir": 780 err = dc.ReadExactBytes((z.DataDir)[:]) 781 if err != nil { 782 err = msgp.WrapError(err, "DataDir") 783 return 784 } 785 case "EcAlgo": 786 { 787 var zb0002 uint8 788 zb0002, err = dc.ReadUint8() 789 if err != nil { 790 err = msgp.WrapError(err, "ErasureAlgorithm") 791 return 792 } 793 z.ErasureAlgorithm = ErasureAlgo(zb0002) 794 } 795 case "EcM": 796 z.ErasureM, err = dc.ReadInt() 797 if err != nil { 798 err = msgp.WrapError(err, "ErasureM") 799 return 800 } 801 case "EcN": 802 z.ErasureN, err = dc.ReadInt() 803 if err != nil { 804 err = msgp.WrapError(err, "ErasureN") 805 return 806 } 807 case "EcBSize": 808 z.ErasureBlockSize, err = dc.ReadInt64() 809 if err != nil { 810 err = msgp.WrapError(err, "ErasureBlockSize") 811 return 812 } 813 case "EcIndex": 814 z.ErasureIndex, err = dc.ReadInt() 815 if err != nil { 816 err = msgp.WrapError(err, "ErasureIndex") 817 return 818 } 819 case "EcDist": 820 var zb0003 uint32 821 zb0003, err = dc.ReadArrayHeader() 822 if err != nil { 823 err = msgp.WrapError(err, "ErasureDist") 824 return 825 } 826 if cap(z.ErasureDist) >= int(zb0003) { 827 z.ErasureDist = (z.ErasureDist)[:zb0003] 828 } else { 829 z.ErasureDist = make([]uint8, zb0003) 830 } 831 for za0003 := range z.ErasureDist { 832 z.ErasureDist[za0003], err = dc.ReadUint8() 833 if err != nil { 834 err = msgp.WrapError(err, "ErasureDist", za0003) 835 return 836 } 837 } 838 case "CSumAlgo": 839 { 840 var zb0004 uint8 841 zb0004, err = dc.ReadUint8() 842 if err != nil { 843 err = msgp.WrapError(err, "BitrotChecksumAlgo") 844 return 845 } 846 z.BitrotChecksumAlgo = ChecksumAlgo(zb0004) 847 } 848 case "PartNums": 849 var zb0005 uint32 850 zb0005, err = dc.ReadArrayHeader() 851 if err != nil { 852 err = msgp.WrapError(err, "PartNumbers") 853 return 854 } 855 if cap(z.PartNumbers) >= int(zb0005) { 856 z.PartNumbers = (z.PartNumbers)[:zb0005] 857 } else { 858 z.PartNumbers = make([]int, zb0005) 859 } 860 for za0004 := range z.PartNumbers { 861 z.PartNumbers[za0004], err = dc.ReadInt() 862 if err != nil { 863 err = msgp.WrapError(err, "PartNumbers", za0004) 864 return 865 } 866 } 867 case "PartETags": 868 if dc.IsNil() { 869 err = dc.ReadNil() 870 if err != nil { 871 err = msgp.WrapError(err, "PartETags") 872 return 873 } 874 z.PartETags = nil 875 } else { 876 var zb0006 uint32 877 zb0006, err = dc.ReadArrayHeader() 878 if err != nil { 879 err = msgp.WrapError(err, "PartETags") 880 return 881 } 882 if z.PartETags != nil && cap(z.PartETags) >= int(zb0006) { 883 z.PartETags = (z.PartETags)[:zb0006] 884 } else { 885 z.PartETags = make([]string, zb0006) 886 } 887 for za0005 := range z.PartETags { 888 z.PartETags[za0005], err = dc.ReadString() 889 if err != nil { 890 err = msgp.WrapError(err, "PartETags", za0005) 891 return 892 } 893 } 894 } 895 case "PartSizes": 896 var zb0007 uint32 897 zb0007, err = dc.ReadArrayHeader() 898 if err != nil { 899 err = msgp.WrapError(err, "PartSizes") 900 return 901 } 902 if cap(z.PartSizes) >= int(zb0007) { 903 z.PartSizes = (z.PartSizes)[:zb0007] 904 } else { 905 z.PartSizes = make([]int64, zb0007) 906 } 907 for za0006 := range z.PartSizes { 908 z.PartSizes[za0006], err = dc.ReadInt64() 909 if err != nil { 910 err = msgp.WrapError(err, "PartSizes", za0006) 911 return 912 } 913 } 914 case "PartASizes": 915 if dc.IsNil() { 916 err = dc.ReadNil() 917 if err != nil { 918 err = msgp.WrapError(err, "PartActualSizes") 919 return 920 } 921 z.PartActualSizes = nil 922 } else { 923 var zb0008 uint32 924 zb0008, err = dc.ReadArrayHeader() 925 if err != nil { 926 err = msgp.WrapError(err, "PartActualSizes") 927 return 928 } 929 if z.PartActualSizes != nil && cap(z.PartActualSizes) >= int(zb0008) { 930 z.PartActualSizes = (z.PartActualSizes)[:zb0008] 931 } else { 932 z.PartActualSizes = make([]int64, zb0008) 933 } 934 for za0007 := range z.PartActualSizes { 935 z.PartActualSizes[za0007], err = dc.ReadInt64() 936 if err != nil { 937 err = msgp.WrapError(err, "PartActualSizes", za0007) 938 return 939 } 940 } 941 } 942 case "PartIdx": 943 var zb0009 uint32 944 zb0009, err = dc.ReadArrayHeader() 945 if err != nil { 946 err = msgp.WrapError(err, "PartIndices") 947 return 948 } 949 if cap(z.PartIndices) >= int(zb0009) { 950 z.PartIndices = (z.PartIndices)[:zb0009] 951 } else { 952 z.PartIndices = make([][]byte, zb0009) 953 } 954 for za0008 := range z.PartIndices { 955 z.PartIndices[za0008], err = dc.ReadBytes(z.PartIndices[za0008]) 956 if err != nil { 957 err = msgp.WrapError(err, "PartIndices", za0008) 958 return 959 } 960 } 961 case "Size": 962 z.Size, err = dc.ReadInt64() 963 if err != nil { 964 err = msgp.WrapError(err, "Size") 965 return 966 } 967 case "MTime": 968 z.ModTime, err = dc.ReadInt64() 969 if err != nil { 970 err = msgp.WrapError(err, "ModTime") 971 return 972 } 973 case "MetaSys": 974 if dc.IsNil() { 975 err = dc.ReadNil() 976 if err != nil { 977 err = msgp.WrapError(err, "MetaSys") 978 return 979 } 980 z.MetaSys = nil 981 } else { 982 var zb0010 uint32 983 zb0010, err = dc.ReadMapHeader() 984 if err != nil { 985 err = msgp.WrapError(err, "MetaSys") 986 return 987 } 988 if z.MetaSys == nil { 989 z.MetaSys = make(map[string][]byte, zb0010) 990 } else if len(z.MetaSys) > 0 { 991 for key := range z.MetaSys { 992 delete(z.MetaSys, key) 993 } 994 } 995 for zb0010 > 0 { 996 zb0010-- 997 var za0009 string 998 var za0010 []byte 999 za0009, err = dc.ReadString() 1000 if err != nil { 1001 err = msgp.WrapError(err, "MetaSys") 1002 return 1003 } 1004 za0010, err = dc.ReadBytes(za0010) 1005 if err != nil { 1006 err = msgp.WrapError(err, "MetaSys", za0009) 1007 return 1008 } 1009 z.MetaSys[za0009] = za0010 1010 } 1011 } 1012 case "MetaUsr": 1013 if dc.IsNil() { 1014 err = dc.ReadNil() 1015 if err != nil { 1016 err = msgp.WrapError(err, "MetaUser") 1017 return 1018 } 1019 z.MetaUser = nil 1020 } else { 1021 var zb0011 uint32 1022 zb0011, err = dc.ReadMapHeader() 1023 if err != nil { 1024 err = msgp.WrapError(err, "MetaUser") 1025 return 1026 } 1027 if z.MetaUser == nil { 1028 z.MetaUser = make(map[string]string, zb0011) 1029 } else if len(z.MetaUser) > 0 { 1030 for key := range z.MetaUser { 1031 delete(z.MetaUser, key) 1032 } 1033 } 1034 for zb0011 > 0 { 1035 zb0011-- 1036 var za0011 string 1037 var za0012 string 1038 za0011, err = dc.ReadString() 1039 if err != nil { 1040 err = msgp.WrapError(err, "MetaUser") 1041 return 1042 } 1043 za0012, err = dc.ReadString() 1044 if err != nil { 1045 err = msgp.WrapError(err, "MetaUser", za0011) 1046 return 1047 } 1048 z.MetaUser[za0011] = za0012 1049 } 1050 } 1051 default: 1052 err = dc.Skip() 1053 if err != nil { 1054 err = msgp.WrapError(err) 1055 return 1056 } 1057 } 1058 } 1059 return 1060 } 1061 1062 // EncodeMsg implements msgp.Encodable 1063 func (z *xlMetaV2Object) EncodeMsg(en *msgp.Writer) (err error) { 1064 // check for omitted fields 1065 zb0001Len := uint32(18) 1066 var zb0001Mask uint32 /* 18 bits */ 1067 _ = zb0001Mask 1068 if z.PartIndices == nil { 1069 zb0001Len-- 1070 zb0001Mask |= 0x2000 1071 } 1072 // variable map header, size zb0001Len 1073 err = en.WriteMapHeader(zb0001Len) 1074 if err != nil { 1075 return 1076 } 1077 if zb0001Len == 0 { 1078 return 1079 } 1080 // write "ID" 1081 err = en.Append(0xa2, 0x49, 0x44) 1082 if err != nil { 1083 return 1084 } 1085 err = en.WriteBytes((z.VersionID)[:]) 1086 if err != nil { 1087 err = msgp.WrapError(err, "VersionID") 1088 return 1089 } 1090 // write "DDir" 1091 err = en.Append(0xa4, 0x44, 0x44, 0x69, 0x72) 1092 if err != nil { 1093 return 1094 } 1095 err = en.WriteBytes((z.DataDir)[:]) 1096 if err != nil { 1097 err = msgp.WrapError(err, "DataDir") 1098 return 1099 } 1100 // write "EcAlgo" 1101 err = en.Append(0xa6, 0x45, 0x63, 0x41, 0x6c, 0x67, 0x6f) 1102 if err != nil { 1103 return 1104 } 1105 err = en.WriteUint8(uint8(z.ErasureAlgorithm)) 1106 if err != nil { 1107 err = msgp.WrapError(err, "ErasureAlgorithm") 1108 return 1109 } 1110 // write "EcM" 1111 err = en.Append(0xa3, 0x45, 0x63, 0x4d) 1112 if err != nil { 1113 return 1114 } 1115 err = en.WriteInt(z.ErasureM) 1116 if err != nil { 1117 err = msgp.WrapError(err, "ErasureM") 1118 return 1119 } 1120 // write "EcN" 1121 err = en.Append(0xa3, 0x45, 0x63, 0x4e) 1122 if err != nil { 1123 return 1124 } 1125 err = en.WriteInt(z.ErasureN) 1126 if err != nil { 1127 err = msgp.WrapError(err, "ErasureN") 1128 return 1129 } 1130 // write "EcBSize" 1131 err = en.Append(0xa7, 0x45, 0x63, 0x42, 0x53, 0x69, 0x7a, 0x65) 1132 if err != nil { 1133 return 1134 } 1135 err = en.WriteInt64(z.ErasureBlockSize) 1136 if err != nil { 1137 err = msgp.WrapError(err, "ErasureBlockSize") 1138 return 1139 } 1140 // write "EcIndex" 1141 err = en.Append(0xa7, 0x45, 0x63, 0x49, 0x6e, 0x64, 0x65, 0x78) 1142 if err != nil { 1143 return 1144 } 1145 err = en.WriteInt(z.ErasureIndex) 1146 if err != nil { 1147 err = msgp.WrapError(err, "ErasureIndex") 1148 return 1149 } 1150 // write "EcDist" 1151 err = en.Append(0xa6, 0x45, 0x63, 0x44, 0x69, 0x73, 0x74) 1152 if err != nil { 1153 return 1154 } 1155 err = en.WriteArrayHeader(uint32(len(z.ErasureDist))) 1156 if err != nil { 1157 err = msgp.WrapError(err, "ErasureDist") 1158 return 1159 } 1160 for za0003 := range z.ErasureDist { 1161 err = en.WriteUint8(z.ErasureDist[za0003]) 1162 if err != nil { 1163 err = msgp.WrapError(err, "ErasureDist", za0003) 1164 return 1165 } 1166 } 1167 // write "CSumAlgo" 1168 err = en.Append(0xa8, 0x43, 0x53, 0x75, 0x6d, 0x41, 0x6c, 0x67, 0x6f) 1169 if err != nil { 1170 return 1171 } 1172 err = en.WriteUint8(uint8(z.BitrotChecksumAlgo)) 1173 if err != nil { 1174 err = msgp.WrapError(err, "BitrotChecksumAlgo") 1175 return 1176 } 1177 // write "PartNums" 1178 err = en.Append(0xa8, 0x50, 0x61, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x73) 1179 if err != nil { 1180 return 1181 } 1182 err = en.WriteArrayHeader(uint32(len(z.PartNumbers))) 1183 if err != nil { 1184 err = msgp.WrapError(err, "PartNumbers") 1185 return 1186 } 1187 for za0004 := range z.PartNumbers { 1188 err = en.WriteInt(z.PartNumbers[za0004]) 1189 if err != nil { 1190 err = msgp.WrapError(err, "PartNumbers", za0004) 1191 return 1192 } 1193 } 1194 // write "PartETags" 1195 err = en.Append(0xa9, 0x50, 0x61, 0x72, 0x74, 0x45, 0x54, 0x61, 0x67, 0x73) 1196 if err != nil { 1197 return 1198 } 1199 if z.PartETags == nil { // allownil: if nil 1200 err = en.WriteNil() 1201 if err != nil { 1202 return 1203 } 1204 } else { 1205 err = en.WriteArrayHeader(uint32(len(z.PartETags))) 1206 if err != nil { 1207 err = msgp.WrapError(err, "PartETags") 1208 return 1209 } 1210 for za0005 := range z.PartETags { 1211 err = en.WriteString(z.PartETags[za0005]) 1212 if err != nil { 1213 err = msgp.WrapError(err, "PartETags", za0005) 1214 return 1215 } 1216 } 1217 } 1218 // write "PartSizes" 1219 err = en.Append(0xa9, 0x50, 0x61, 0x72, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x73) 1220 if err != nil { 1221 return 1222 } 1223 err = en.WriteArrayHeader(uint32(len(z.PartSizes))) 1224 if err != nil { 1225 err = msgp.WrapError(err, "PartSizes") 1226 return 1227 } 1228 for za0006 := range z.PartSizes { 1229 err = en.WriteInt64(z.PartSizes[za0006]) 1230 if err != nil { 1231 err = msgp.WrapError(err, "PartSizes", za0006) 1232 return 1233 } 1234 } 1235 // write "PartASizes" 1236 err = en.Append(0xaa, 0x50, 0x61, 0x72, 0x74, 0x41, 0x53, 0x69, 0x7a, 0x65, 0x73) 1237 if err != nil { 1238 return 1239 } 1240 if z.PartActualSizes == nil { // allownil: if nil 1241 err = en.WriteNil() 1242 if err != nil { 1243 return 1244 } 1245 } else { 1246 err = en.WriteArrayHeader(uint32(len(z.PartActualSizes))) 1247 if err != nil { 1248 err = msgp.WrapError(err, "PartActualSizes") 1249 return 1250 } 1251 for za0007 := range z.PartActualSizes { 1252 err = en.WriteInt64(z.PartActualSizes[za0007]) 1253 if err != nil { 1254 err = msgp.WrapError(err, "PartActualSizes", za0007) 1255 return 1256 } 1257 } 1258 } 1259 if (zb0001Mask & 0x2000) == 0 { // if not omitted 1260 // write "PartIdx" 1261 err = en.Append(0xa7, 0x50, 0x61, 0x72, 0x74, 0x49, 0x64, 0x78) 1262 if err != nil { 1263 return 1264 } 1265 err = en.WriteArrayHeader(uint32(len(z.PartIndices))) 1266 if err != nil { 1267 err = msgp.WrapError(err, "PartIndices") 1268 return 1269 } 1270 for za0008 := range z.PartIndices { 1271 err = en.WriteBytes(z.PartIndices[za0008]) 1272 if err != nil { 1273 err = msgp.WrapError(err, "PartIndices", za0008) 1274 return 1275 } 1276 } 1277 } 1278 // write "Size" 1279 err = en.Append(0xa4, 0x53, 0x69, 0x7a, 0x65) 1280 if err != nil { 1281 return 1282 } 1283 err = en.WriteInt64(z.Size) 1284 if err != nil { 1285 err = msgp.WrapError(err, "Size") 1286 return 1287 } 1288 // write "MTime" 1289 err = en.Append(0xa5, 0x4d, 0x54, 0x69, 0x6d, 0x65) 1290 if err != nil { 1291 return 1292 } 1293 err = en.WriteInt64(z.ModTime) 1294 if err != nil { 1295 err = msgp.WrapError(err, "ModTime") 1296 return 1297 } 1298 // write "MetaSys" 1299 err = en.Append(0xa7, 0x4d, 0x65, 0x74, 0x61, 0x53, 0x79, 0x73) 1300 if err != nil { 1301 return 1302 } 1303 if z.MetaSys == nil { // allownil: if nil 1304 err = en.WriteNil() 1305 if err != nil { 1306 return 1307 } 1308 } else { 1309 err = en.WriteMapHeader(uint32(len(z.MetaSys))) 1310 if err != nil { 1311 err = msgp.WrapError(err, "MetaSys") 1312 return 1313 } 1314 for za0009, za0010 := range z.MetaSys { 1315 err = en.WriteString(za0009) 1316 if err != nil { 1317 err = msgp.WrapError(err, "MetaSys") 1318 return 1319 } 1320 err = en.WriteBytes(za0010) 1321 if err != nil { 1322 err = msgp.WrapError(err, "MetaSys", za0009) 1323 return 1324 } 1325 } 1326 } 1327 // write "MetaUsr" 1328 err = en.Append(0xa7, 0x4d, 0x65, 0x74, 0x61, 0x55, 0x73, 0x72) 1329 if err != nil { 1330 return 1331 } 1332 if z.MetaUser == nil { // allownil: if nil 1333 err = en.WriteNil() 1334 if err != nil { 1335 return 1336 } 1337 } else { 1338 err = en.WriteMapHeader(uint32(len(z.MetaUser))) 1339 if err != nil { 1340 err = msgp.WrapError(err, "MetaUser") 1341 return 1342 } 1343 for za0011, za0012 := range z.MetaUser { 1344 err = en.WriteString(za0011) 1345 if err != nil { 1346 err = msgp.WrapError(err, "MetaUser") 1347 return 1348 } 1349 err = en.WriteString(za0012) 1350 if err != nil { 1351 err = msgp.WrapError(err, "MetaUser", za0011) 1352 return 1353 } 1354 } 1355 } 1356 return 1357 } 1358 1359 // MarshalMsg implements msgp.Marshaler 1360 func (z *xlMetaV2Object) MarshalMsg(b []byte) (o []byte, err error) { 1361 o = msgp.Require(b, z.Msgsize()) 1362 // check for omitted fields 1363 zb0001Len := uint32(18) 1364 var zb0001Mask uint32 /* 18 bits */ 1365 _ = zb0001Mask 1366 if z.PartIndices == nil { 1367 zb0001Len-- 1368 zb0001Mask |= 0x2000 1369 } 1370 // variable map header, size zb0001Len 1371 o = msgp.AppendMapHeader(o, zb0001Len) 1372 if zb0001Len == 0 { 1373 return 1374 } 1375 // string "ID" 1376 o = append(o, 0xa2, 0x49, 0x44) 1377 o = msgp.AppendBytes(o, (z.VersionID)[:]) 1378 // string "DDir" 1379 o = append(o, 0xa4, 0x44, 0x44, 0x69, 0x72) 1380 o = msgp.AppendBytes(o, (z.DataDir)[:]) 1381 // string "EcAlgo" 1382 o = append(o, 0xa6, 0x45, 0x63, 0x41, 0x6c, 0x67, 0x6f) 1383 o = msgp.AppendUint8(o, uint8(z.ErasureAlgorithm)) 1384 // string "EcM" 1385 o = append(o, 0xa3, 0x45, 0x63, 0x4d) 1386 o = msgp.AppendInt(o, z.ErasureM) 1387 // string "EcN" 1388 o = append(o, 0xa3, 0x45, 0x63, 0x4e) 1389 o = msgp.AppendInt(o, z.ErasureN) 1390 // string "EcBSize" 1391 o = append(o, 0xa7, 0x45, 0x63, 0x42, 0x53, 0x69, 0x7a, 0x65) 1392 o = msgp.AppendInt64(o, z.ErasureBlockSize) 1393 // string "EcIndex" 1394 o = append(o, 0xa7, 0x45, 0x63, 0x49, 0x6e, 0x64, 0x65, 0x78) 1395 o = msgp.AppendInt(o, z.ErasureIndex) 1396 // string "EcDist" 1397 o = append(o, 0xa6, 0x45, 0x63, 0x44, 0x69, 0x73, 0x74) 1398 o = msgp.AppendArrayHeader(o, uint32(len(z.ErasureDist))) 1399 for za0003 := range z.ErasureDist { 1400 o = msgp.AppendUint8(o, z.ErasureDist[za0003]) 1401 } 1402 // string "CSumAlgo" 1403 o = append(o, 0xa8, 0x43, 0x53, 0x75, 0x6d, 0x41, 0x6c, 0x67, 0x6f) 1404 o = msgp.AppendUint8(o, uint8(z.BitrotChecksumAlgo)) 1405 // string "PartNums" 1406 o = append(o, 0xa8, 0x50, 0x61, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x73) 1407 o = msgp.AppendArrayHeader(o, uint32(len(z.PartNumbers))) 1408 for za0004 := range z.PartNumbers { 1409 o = msgp.AppendInt(o, z.PartNumbers[za0004]) 1410 } 1411 // string "PartETags" 1412 o = append(o, 0xa9, 0x50, 0x61, 0x72, 0x74, 0x45, 0x54, 0x61, 0x67, 0x73) 1413 if z.PartETags == nil { // allownil: if nil 1414 o = msgp.AppendNil(o) 1415 } else { 1416 o = msgp.AppendArrayHeader(o, uint32(len(z.PartETags))) 1417 for za0005 := range z.PartETags { 1418 o = msgp.AppendString(o, z.PartETags[za0005]) 1419 } 1420 } 1421 // string "PartSizes" 1422 o = append(o, 0xa9, 0x50, 0x61, 0x72, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x73) 1423 o = msgp.AppendArrayHeader(o, uint32(len(z.PartSizes))) 1424 for za0006 := range z.PartSizes { 1425 o = msgp.AppendInt64(o, z.PartSizes[za0006]) 1426 } 1427 // string "PartASizes" 1428 o = append(o, 0xaa, 0x50, 0x61, 0x72, 0x74, 0x41, 0x53, 0x69, 0x7a, 0x65, 0x73) 1429 if z.PartActualSizes == nil { // allownil: if nil 1430 o = msgp.AppendNil(o) 1431 } else { 1432 o = msgp.AppendArrayHeader(o, uint32(len(z.PartActualSizes))) 1433 for za0007 := range z.PartActualSizes { 1434 o = msgp.AppendInt64(o, z.PartActualSizes[za0007]) 1435 } 1436 } 1437 if (zb0001Mask & 0x2000) == 0 { // if not omitted 1438 // string "PartIdx" 1439 o = append(o, 0xa7, 0x50, 0x61, 0x72, 0x74, 0x49, 0x64, 0x78) 1440 o = msgp.AppendArrayHeader(o, uint32(len(z.PartIndices))) 1441 for za0008 := range z.PartIndices { 1442 o = msgp.AppendBytes(o, z.PartIndices[za0008]) 1443 } 1444 } 1445 // string "Size" 1446 o = append(o, 0xa4, 0x53, 0x69, 0x7a, 0x65) 1447 o = msgp.AppendInt64(o, z.Size) 1448 // string "MTime" 1449 o = append(o, 0xa5, 0x4d, 0x54, 0x69, 0x6d, 0x65) 1450 o = msgp.AppendInt64(o, z.ModTime) 1451 // string "MetaSys" 1452 o = append(o, 0xa7, 0x4d, 0x65, 0x74, 0x61, 0x53, 0x79, 0x73) 1453 if z.MetaSys == nil { // allownil: if nil 1454 o = msgp.AppendNil(o) 1455 } else { 1456 o = msgp.AppendMapHeader(o, uint32(len(z.MetaSys))) 1457 for za0009, za0010 := range z.MetaSys { 1458 o = msgp.AppendString(o, za0009) 1459 o = msgp.AppendBytes(o, za0010) 1460 } 1461 } 1462 // string "MetaUsr" 1463 o = append(o, 0xa7, 0x4d, 0x65, 0x74, 0x61, 0x55, 0x73, 0x72) 1464 if z.MetaUser == nil { // allownil: if nil 1465 o = msgp.AppendNil(o) 1466 } else { 1467 o = msgp.AppendMapHeader(o, uint32(len(z.MetaUser))) 1468 for za0011, za0012 := range z.MetaUser { 1469 o = msgp.AppendString(o, za0011) 1470 o = msgp.AppendString(o, za0012) 1471 } 1472 } 1473 return 1474 } 1475 1476 // UnmarshalMsg implements msgp.Unmarshaler 1477 func (z *xlMetaV2Object) UnmarshalMsg(bts []byte) (o []byte, err error) { 1478 var field []byte 1479 _ = field 1480 var zb0001 uint32 1481 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 1482 if err != nil { 1483 err = msgp.WrapError(err) 1484 return 1485 } 1486 for zb0001 > 0 { 1487 zb0001-- 1488 field, bts, err = msgp.ReadMapKeyZC(bts) 1489 if err != nil { 1490 err = msgp.WrapError(err) 1491 return 1492 } 1493 switch msgp.UnsafeString(field) { 1494 case "ID": 1495 bts, err = msgp.ReadExactBytes(bts, (z.VersionID)[:]) 1496 if err != nil { 1497 err = msgp.WrapError(err, "VersionID") 1498 return 1499 } 1500 case "DDir": 1501 bts, err = msgp.ReadExactBytes(bts, (z.DataDir)[:]) 1502 if err != nil { 1503 err = msgp.WrapError(err, "DataDir") 1504 return 1505 } 1506 case "EcAlgo": 1507 { 1508 var zb0002 uint8 1509 zb0002, bts, err = msgp.ReadUint8Bytes(bts) 1510 if err != nil { 1511 err = msgp.WrapError(err, "ErasureAlgorithm") 1512 return 1513 } 1514 z.ErasureAlgorithm = ErasureAlgo(zb0002) 1515 } 1516 case "EcM": 1517 z.ErasureM, bts, err = msgp.ReadIntBytes(bts) 1518 if err != nil { 1519 err = msgp.WrapError(err, "ErasureM") 1520 return 1521 } 1522 case "EcN": 1523 z.ErasureN, bts, err = msgp.ReadIntBytes(bts) 1524 if err != nil { 1525 err = msgp.WrapError(err, "ErasureN") 1526 return 1527 } 1528 case "EcBSize": 1529 z.ErasureBlockSize, bts, err = msgp.ReadInt64Bytes(bts) 1530 if err != nil { 1531 err = msgp.WrapError(err, "ErasureBlockSize") 1532 return 1533 } 1534 case "EcIndex": 1535 z.ErasureIndex, bts, err = msgp.ReadIntBytes(bts) 1536 if err != nil { 1537 err = msgp.WrapError(err, "ErasureIndex") 1538 return 1539 } 1540 case "EcDist": 1541 var zb0003 uint32 1542 zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) 1543 if err != nil { 1544 err = msgp.WrapError(err, "ErasureDist") 1545 return 1546 } 1547 if cap(z.ErasureDist) >= int(zb0003) { 1548 z.ErasureDist = (z.ErasureDist)[:zb0003] 1549 } else { 1550 z.ErasureDist = make([]uint8, zb0003) 1551 } 1552 for za0003 := range z.ErasureDist { 1553 z.ErasureDist[za0003], bts, err = msgp.ReadUint8Bytes(bts) 1554 if err != nil { 1555 err = msgp.WrapError(err, "ErasureDist", za0003) 1556 return 1557 } 1558 } 1559 case "CSumAlgo": 1560 { 1561 var zb0004 uint8 1562 zb0004, bts, err = msgp.ReadUint8Bytes(bts) 1563 if err != nil { 1564 err = msgp.WrapError(err, "BitrotChecksumAlgo") 1565 return 1566 } 1567 z.BitrotChecksumAlgo = ChecksumAlgo(zb0004) 1568 } 1569 case "PartNums": 1570 var zb0005 uint32 1571 zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts) 1572 if err != nil { 1573 err = msgp.WrapError(err, "PartNumbers") 1574 return 1575 } 1576 if cap(z.PartNumbers) >= int(zb0005) { 1577 z.PartNumbers = (z.PartNumbers)[:zb0005] 1578 } else { 1579 z.PartNumbers = make([]int, zb0005) 1580 } 1581 for za0004 := range z.PartNumbers { 1582 z.PartNumbers[za0004], bts, err = msgp.ReadIntBytes(bts) 1583 if err != nil { 1584 err = msgp.WrapError(err, "PartNumbers", za0004) 1585 return 1586 } 1587 } 1588 case "PartETags": 1589 if msgp.IsNil(bts) { 1590 bts = bts[1:] 1591 z.PartETags = nil 1592 } else { 1593 var zb0006 uint32 1594 zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts) 1595 if err != nil { 1596 err = msgp.WrapError(err, "PartETags") 1597 return 1598 } 1599 if z.PartETags != nil && cap(z.PartETags) >= int(zb0006) { 1600 z.PartETags = (z.PartETags)[:zb0006] 1601 } else { 1602 z.PartETags = make([]string, zb0006) 1603 } 1604 for za0005 := range z.PartETags { 1605 z.PartETags[za0005], bts, err = msgp.ReadStringBytes(bts) 1606 if err != nil { 1607 err = msgp.WrapError(err, "PartETags", za0005) 1608 return 1609 } 1610 } 1611 } 1612 case "PartSizes": 1613 var zb0007 uint32 1614 zb0007, bts, err = msgp.ReadArrayHeaderBytes(bts) 1615 if err != nil { 1616 err = msgp.WrapError(err, "PartSizes") 1617 return 1618 } 1619 if cap(z.PartSizes) >= int(zb0007) { 1620 z.PartSizes = (z.PartSizes)[:zb0007] 1621 } else { 1622 z.PartSizes = make([]int64, zb0007) 1623 } 1624 for za0006 := range z.PartSizes { 1625 z.PartSizes[za0006], bts, err = msgp.ReadInt64Bytes(bts) 1626 if err != nil { 1627 err = msgp.WrapError(err, "PartSizes", za0006) 1628 return 1629 } 1630 } 1631 case "PartASizes": 1632 if msgp.IsNil(bts) { 1633 bts = bts[1:] 1634 z.PartActualSizes = nil 1635 } else { 1636 var zb0008 uint32 1637 zb0008, bts, err = msgp.ReadArrayHeaderBytes(bts) 1638 if err != nil { 1639 err = msgp.WrapError(err, "PartActualSizes") 1640 return 1641 } 1642 if z.PartActualSizes != nil && cap(z.PartActualSizes) >= int(zb0008) { 1643 z.PartActualSizes = (z.PartActualSizes)[:zb0008] 1644 } else { 1645 z.PartActualSizes = make([]int64, zb0008) 1646 } 1647 for za0007 := range z.PartActualSizes { 1648 z.PartActualSizes[za0007], bts, err = msgp.ReadInt64Bytes(bts) 1649 if err != nil { 1650 err = msgp.WrapError(err, "PartActualSizes", za0007) 1651 return 1652 } 1653 } 1654 } 1655 case "PartIdx": 1656 var zb0009 uint32 1657 zb0009, bts, err = msgp.ReadArrayHeaderBytes(bts) 1658 if err != nil { 1659 err = msgp.WrapError(err, "PartIndices") 1660 return 1661 } 1662 if cap(z.PartIndices) >= int(zb0009) { 1663 z.PartIndices = (z.PartIndices)[:zb0009] 1664 } else { 1665 z.PartIndices = make([][]byte, zb0009) 1666 } 1667 for za0008 := range z.PartIndices { 1668 z.PartIndices[za0008], bts, err = msgp.ReadBytesBytes(bts, z.PartIndices[za0008]) 1669 if err != nil { 1670 err = msgp.WrapError(err, "PartIndices", za0008) 1671 return 1672 } 1673 } 1674 case "Size": 1675 z.Size, bts, err = msgp.ReadInt64Bytes(bts) 1676 if err != nil { 1677 err = msgp.WrapError(err, "Size") 1678 return 1679 } 1680 case "MTime": 1681 z.ModTime, bts, err = msgp.ReadInt64Bytes(bts) 1682 if err != nil { 1683 err = msgp.WrapError(err, "ModTime") 1684 return 1685 } 1686 case "MetaSys": 1687 if msgp.IsNil(bts) { 1688 bts = bts[1:] 1689 z.MetaSys = nil 1690 } else { 1691 var zb0010 uint32 1692 zb0010, bts, err = msgp.ReadMapHeaderBytes(bts) 1693 if err != nil { 1694 err = msgp.WrapError(err, "MetaSys") 1695 return 1696 } 1697 if z.MetaSys == nil { 1698 z.MetaSys = make(map[string][]byte, zb0010) 1699 } else if len(z.MetaSys) > 0 { 1700 for key := range z.MetaSys { 1701 delete(z.MetaSys, key) 1702 } 1703 } 1704 for zb0010 > 0 { 1705 var za0009 string 1706 var za0010 []byte 1707 zb0010-- 1708 za0009, bts, err = msgp.ReadStringBytes(bts) 1709 if err != nil { 1710 err = msgp.WrapError(err, "MetaSys") 1711 return 1712 } 1713 za0010, bts, err = msgp.ReadBytesBytes(bts, za0010) 1714 if err != nil { 1715 err = msgp.WrapError(err, "MetaSys", za0009) 1716 return 1717 } 1718 z.MetaSys[za0009] = za0010 1719 } 1720 } 1721 case "MetaUsr": 1722 if msgp.IsNil(bts) { 1723 bts = bts[1:] 1724 z.MetaUser = nil 1725 } else { 1726 var zb0011 uint32 1727 zb0011, bts, err = msgp.ReadMapHeaderBytes(bts) 1728 if err != nil { 1729 err = msgp.WrapError(err, "MetaUser") 1730 return 1731 } 1732 if z.MetaUser == nil { 1733 z.MetaUser = make(map[string]string, zb0011) 1734 } else if len(z.MetaUser) > 0 { 1735 for key := range z.MetaUser { 1736 delete(z.MetaUser, key) 1737 } 1738 } 1739 for zb0011 > 0 { 1740 var za0011 string 1741 var za0012 string 1742 zb0011-- 1743 za0011, bts, err = msgp.ReadStringBytes(bts) 1744 if err != nil { 1745 err = msgp.WrapError(err, "MetaUser") 1746 return 1747 } 1748 za0012, bts, err = msgp.ReadStringBytes(bts) 1749 if err != nil { 1750 err = msgp.WrapError(err, "MetaUser", za0011) 1751 return 1752 } 1753 z.MetaUser[za0011] = za0012 1754 } 1755 } 1756 default: 1757 bts, err = msgp.Skip(bts) 1758 if err != nil { 1759 err = msgp.WrapError(err) 1760 return 1761 } 1762 } 1763 } 1764 o = bts 1765 return 1766 } 1767 1768 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1769 func (z *xlMetaV2Object) Msgsize() (s int) { 1770 s = 3 + 3 + msgp.ArrayHeaderSize + (16 * (msgp.ByteSize)) + 5 + msgp.ArrayHeaderSize + (16 * (msgp.ByteSize)) + 7 + msgp.Uint8Size + 4 + msgp.IntSize + 4 + msgp.IntSize + 8 + msgp.Int64Size + 8 + msgp.IntSize + 7 + msgp.ArrayHeaderSize + (len(z.ErasureDist) * (msgp.Uint8Size)) + 9 + msgp.Uint8Size + 9 + msgp.ArrayHeaderSize + (len(z.PartNumbers) * (msgp.IntSize)) + 10 + msgp.ArrayHeaderSize 1771 for za0005 := range z.PartETags { 1772 s += msgp.StringPrefixSize + len(z.PartETags[za0005]) 1773 } 1774 s += 10 + msgp.ArrayHeaderSize + (len(z.PartSizes) * (msgp.Int64Size)) + 11 + msgp.ArrayHeaderSize + (len(z.PartActualSizes) * (msgp.Int64Size)) + 8 + msgp.ArrayHeaderSize 1775 for za0008 := range z.PartIndices { 1776 s += msgp.BytesPrefixSize + len(z.PartIndices[za0008]) 1777 } 1778 s += 5 + msgp.Int64Size + 6 + msgp.Int64Size + 8 + msgp.MapHeaderSize 1779 if z.MetaSys != nil { 1780 for za0009, za0010 := range z.MetaSys { 1781 _ = za0010 1782 s += msgp.StringPrefixSize + len(za0009) + msgp.BytesPrefixSize + len(za0010) 1783 } 1784 } 1785 s += 8 + msgp.MapHeaderSize 1786 if z.MetaUser != nil { 1787 for za0011, za0012 := range z.MetaUser { 1788 _ = za0012 1789 s += msgp.StringPrefixSize + len(za0011) + msgp.StringPrefixSize + len(za0012) 1790 } 1791 } 1792 return 1793 } 1794 1795 // DecodeMsg implements msgp.Decodable 1796 func (z *xlMetaV2Version) DecodeMsg(dc *msgp.Reader) (err error) { 1797 var field []byte 1798 _ = field 1799 var zb0001 uint32 1800 zb0001, err = dc.ReadMapHeader() 1801 if err != nil { 1802 err = msgp.WrapError(err) 1803 return 1804 } 1805 for zb0001 > 0 { 1806 zb0001-- 1807 field, err = dc.ReadMapKeyPtr() 1808 if err != nil { 1809 err = msgp.WrapError(err) 1810 return 1811 } 1812 switch msgp.UnsafeString(field) { 1813 case "Type": 1814 { 1815 var zb0002 uint8 1816 zb0002, err = dc.ReadUint8() 1817 if err != nil { 1818 err = msgp.WrapError(err, "Type") 1819 return 1820 } 1821 z.Type = VersionType(zb0002) 1822 } 1823 case "V1Obj": 1824 if dc.IsNil() { 1825 err = dc.ReadNil() 1826 if err != nil { 1827 err = msgp.WrapError(err, "ObjectV1") 1828 return 1829 } 1830 z.ObjectV1 = nil 1831 } else { 1832 if z.ObjectV1 == nil { 1833 z.ObjectV1 = new(xlMetaV1Object) 1834 } 1835 err = z.ObjectV1.DecodeMsg(dc) 1836 if err != nil { 1837 err = msgp.WrapError(err, "ObjectV1") 1838 return 1839 } 1840 } 1841 case "V2Obj": 1842 if dc.IsNil() { 1843 err = dc.ReadNil() 1844 if err != nil { 1845 err = msgp.WrapError(err, "ObjectV2") 1846 return 1847 } 1848 z.ObjectV2 = nil 1849 } else { 1850 if z.ObjectV2 == nil { 1851 z.ObjectV2 = new(xlMetaV2Object) 1852 } 1853 err = z.ObjectV2.DecodeMsg(dc) 1854 if err != nil { 1855 err = msgp.WrapError(err, "ObjectV2") 1856 return 1857 } 1858 } 1859 case "DelObj": 1860 if dc.IsNil() { 1861 err = dc.ReadNil() 1862 if err != nil { 1863 err = msgp.WrapError(err, "DeleteMarker") 1864 return 1865 } 1866 z.DeleteMarker = nil 1867 } else { 1868 if z.DeleteMarker == nil { 1869 z.DeleteMarker = new(xlMetaV2DeleteMarker) 1870 } 1871 err = z.DeleteMarker.DecodeMsg(dc) 1872 if err != nil { 1873 err = msgp.WrapError(err, "DeleteMarker") 1874 return 1875 } 1876 } 1877 case "v": 1878 z.WrittenByVersion, err = dc.ReadUint64() 1879 if err != nil { 1880 err = msgp.WrapError(err, "WrittenByVersion") 1881 return 1882 } 1883 default: 1884 err = dc.Skip() 1885 if err != nil { 1886 err = msgp.WrapError(err) 1887 return 1888 } 1889 } 1890 } 1891 return 1892 } 1893 1894 // EncodeMsg implements msgp.Encodable 1895 func (z *xlMetaV2Version) EncodeMsg(en *msgp.Writer) (err error) { 1896 // check for omitted fields 1897 zb0001Len := uint32(5) 1898 var zb0001Mask uint8 /* 5 bits */ 1899 _ = zb0001Mask 1900 if z.ObjectV1 == nil { 1901 zb0001Len-- 1902 zb0001Mask |= 0x2 1903 } 1904 if z.ObjectV2 == nil { 1905 zb0001Len-- 1906 zb0001Mask |= 0x4 1907 } 1908 if z.DeleteMarker == nil { 1909 zb0001Len-- 1910 zb0001Mask |= 0x8 1911 } 1912 // variable map header, size zb0001Len 1913 err = en.Append(0x80 | uint8(zb0001Len)) 1914 if err != nil { 1915 return 1916 } 1917 if zb0001Len == 0 { 1918 return 1919 } 1920 // write "Type" 1921 err = en.Append(0xa4, 0x54, 0x79, 0x70, 0x65) 1922 if err != nil { 1923 return 1924 } 1925 err = en.WriteUint8(uint8(z.Type)) 1926 if err != nil { 1927 err = msgp.WrapError(err, "Type") 1928 return 1929 } 1930 if (zb0001Mask & 0x2) == 0 { // if not omitted 1931 // write "V1Obj" 1932 err = en.Append(0xa5, 0x56, 0x31, 0x4f, 0x62, 0x6a) 1933 if err != nil { 1934 return 1935 } 1936 if z.ObjectV1 == nil { 1937 err = en.WriteNil() 1938 if err != nil { 1939 return 1940 } 1941 } else { 1942 err = z.ObjectV1.EncodeMsg(en) 1943 if err != nil { 1944 err = msgp.WrapError(err, "ObjectV1") 1945 return 1946 } 1947 } 1948 } 1949 if (zb0001Mask & 0x4) == 0 { // if not omitted 1950 // write "V2Obj" 1951 err = en.Append(0xa5, 0x56, 0x32, 0x4f, 0x62, 0x6a) 1952 if err != nil { 1953 return 1954 } 1955 if z.ObjectV2 == nil { 1956 err = en.WriteNil() 1957 if err != nil { 1958 return 1959 } 1960 } else { 1961 err = z.ObjectV2.EncodeMsg(en) 1962 if err != nil { 1963 err = msgp.WrapError(err, "ObjectV2") 1964 return 1965 } 1966 } 1967 } 1968 if (zb0001Mask & 0x8) == 0 { // if not omitted 1969 // write "DelObj" 1970 err = en.Append(0xa6, 0x44, 0x65, 0x6c, 0x4f, 0x62, 0x6a) 1971 if err != nil { 1972 return 1973 } 1974 if z.DeleteMarker == nil { 1975 err = en.WriteNil() 1976 if err != nil { 1977 return 1978 } 1979 } else { 1980 err = z.DeleteMarker.EncodeMsg(en) 1981 if err != nil { 1982 err = msgp.WrapError(err, "DeleteMarker") 1983 return 1984 } 1985 } 1986 } 1987 // write "v" 1988 err = en.Append(0xa1, 0x76) 1989 if err != nil { 1990 return 1991 } 1992 err = en.WriteUint64(z.WrittenByVersion) 1993 if err != nil { 1994 err = msgp.WrapError(err, "WrittenByVersion") 1995 return 1996 } 1997 return 1998 } 1999 2000 // MarshalMsg implements msgp.Marshaler 2001 func (z *xlMetaV2Version) MarshalMsg(b []byte) (o []byte, err error) { 2002 o = msgp.Require(b, z.Msgsize()) 2003 // check for omitted fields 2004 zb0001Len := uint32(5) 2005 var zb0001Mask uint8 /* 5 bits */ 2006 _ = zb0001Mask 2007 if z.ObjectV1 == nil { 2008 zb0001Len-- 2009 zb0001Mask |= 0x2 2010 } 2011 if z.ObjectV2 == nil { 2012 zb0001Len-- 2013 zb0001Mask |= 0x4 2014 } 2015 if z.DeleteMarker == nil { 2016 zb0001Len-- 2017 zb0001Mask |= 0x8 2018 } 2019 // variable map header, size zb0001Len 2020 o = append(o, 0x80|uint8(zb0001Len)) 2021 if zb0001Len == 0 { 2022 return 2023 } 2024 // string "Type" 2025 o = append(o, 0xa4, 0x54, 0x79, 0x70, 0x65) 2026 o = msgp.AppendUint8(o, uint8(z.Type)) 2027 if (zb0001Mask & 0x2) == 0 { // if not omitted 2028 // string "V1Obj" 2029 o = append(o, 0xa5, 0x56, 0x31, 0x4f, 0x62, 0x6a) 2030 if z.ObjectV1 == nil { 2031 o = msgp.AppendNil(o) 2032 } else { 2033 o, err = z.ObjectV1.MarshalMsg(o) 2034 if err != nil { 2035 err = msgp.WrapError(err, "ObjectV1") 2036 return 2037 } 2038 } 2039 } 2040 if (zb0001Mask & 0x4) == 0 { // if not omitted 2041 // string "V2Obj" 2042 o = append(o, 0xa5, 0x56, 0x32, 0x4f, 0x62, 0x6a) 2043 if z.ObjectV2 == nil { 2044 o = msgp.AppendNil(o) 2045 } else { 2046 o, err = z.ObjectV2.MarshalMsg(o) 2047 if err != nil { 2048 err = msgp.WrapError(err, "ObjectV2") 2049 return 2050 } 2051 } 2052 } 2053 if (zb0001Mask & 0x8) == 0 { // if not omitted 2054 // string "DelObj" 2055 o = append(o, 0xa6, 0x44, 0x65, 0x6c, 0x4f, 0x62, 0x6a) 2056 if z.DeleteMarker == nil { 2057 o = msgp.AppendNil(o) 2058 } else { 2059 o, err = z.DeleteMarker.MarshalMsg(o) 2060 if err != nil { 2061 err = msgp.WrapError(err, "DeleteMarker") 2062 return 2063 } 2064 } 2065 } 2066 // string "v" 2067 o = append(o, 0xa1, 0x76) 2068 o = msgp.AppendUint64(o, z.WrittenByVersion) 2069 return 2070 } 2071 2072 // UnmarshalMsg implements msgp.Unmarshaler 2073 func (z *xlMetaV2Version) UnmarshalMsg(bts []byte) (o []byte, err error) { 2074 var field []byte 2075 _ = field 2076 var zb0001 uint32 2077 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 2078 if err != nil { 2079 err = msgp.WrapError(err) 2080 return 2081 } 2082 for zb0001 > 0 { 2083 zb0001-- 2084 field, bts, err = msgp.ReadMapKeyZC(bts) 2085 if err != nil { 2086 err = msgp.WrapError(err) 2087 return 2088 } 2089 switch msgp.UnsafeString(field) { 2090 case "Type": 2091 { 2092 var zb0002 uint8 2093 zb0002, bts, err = msgp.ReadUint8Bytes(bts) 2094 if err != nil { 2095 err = msgp.WrapError(err, "Type") 2096 return 2097 } 2098 z.Type = VersionType(zb0002) 2099 } 2100 case "V1Obj": 2101 if msgp.IsNil(bts) { 2102 bts, err = msgp.ReadNilBytes(bts) 2103 if err != nil { 2104 return 2105 } 2106 z.ObjectV1 = nil 2107 } else { 2108 if z.ObjectV1 == nil { 2109 z.ObjectV1 = new(xlMetaV1Object) 2110 } 2111 bts, err = z.ObjectV1.UnmarshalMsg(bts) 2112 if err != nil { 2113 err = msgp.WrapError(err, "ObjectV1") 2114 return 2115 } 2116 } 2117 case "V2Obj": 2118 if msgp.IsNil(bts) { 2119 bts, err = msgp.ReadNilBytes(bts) 2120 if err != nil { 2121 return 2122 } 2123 z.ObjectV2 = nil 2124 } else { 2125 if z.ObjectV2 == nil { 2126 z.ObjectV2 = new(xlMetaV2Object) 2127 } 2128 bts, err = z.ObjectV2.UnmarshalMsg(bts) 2129 if err != nil { 2130 err = msgp.WrapError(err, "ObjectV2") 2131 return 2132 } 2133 } 2134 case "DelObj": 2135 if msgp.IsNil(bts) { 2136 bts, err = msgp.ReadNilBytes(bts) 2137 if err != nil { 2138 return 2139 } 2140 z.DeleteMarker = nil 2141 } else { 2142 if z.DeleteMarker == nil { 2143 z.DeleteMarker = new(xlMetaV2DeleteMarker) 2144 } 2145 bts, err = z.DeleteMarker.UnmarshalMsg(bts) 2146 if err != nil { 2147 err = msgp.WrapError(err, "DeleteMarker") 2148 return 2149 } 2150 } 2151 case "v": 2152 z.WrittenByVersion, bts, err = msgp.ReadUint64Bytes(bts) 2153 if err != nil { 2154 err = msgp.WrapError(err, "WrittenByVersion") 2155 return 2156 } 2157 default: 2158 bts, err = msgp.Skip(bts) 2159 if err != nil { 2160 err = msgp.WrapError(err) 2161 return 2162 } 2163 } 2164 } 2165 o = bts 2166 return 2167 } 2168 2169 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 2170 func (z *xlMetaV2Version) Msgsize() (s int) { 2171 s = 1 + 5 + msgp.Uint8Size + 6 2172 if z.ObjectV1 == nil { 2173 s += msgp.NilSize 2174 } else { 2175 s += z.ObjectV1.Msgsize() 2176 } 2177 s += 6 2178 if z.ObjectV2 == nil { 2179 s += msgp.NilSize 2180 } else { 2181 s += z.ObjectV2.Msgsize() 2182 } 2183 s += 7 2184 if z.DeleteMarker == nil { 2185 s += msgp.NilSize 2186 } else { 2187 s += z.DeleteMarker.Msgsize() 2188 } 2189 s += 2 + msgp.Uint64Size 2190 return 2191 } 2192 2193 // DecodeMsg implements msgp.Decodable 2194 func (z *xlMetaV2VersionHeader) DecodeMsg(dc *msgp.Reader) (err error) { 2195 var zb0001 uint32 2196 zb0001, err = dc.ReadArrayHeader() 2197 if err != nil { 2198 err = msgp.WrapError(err) 2199 return 2200 } 2201 if zb0001 != 5 { 2202 err = msgp.ArrayError{Wanted: 5, Got: zb0001} 2203 return 2204 } 2205 err = dc.ReadExactBytes((z.VersionID)[:]) 2206 if err != nil { 2207 err = msgp.WrapError(err, "VersionID") 2208 return 2209 } 2210 z.ModTime, err = dc.ReadInt64() 2211 if err != nil { 2212 err = msgp.WrapError(err, "ModTime") 2213 return 2214 } 2215 err = dc.ReadExactBytes((z.Signature)[:]) 2216 if err != nil { 2217 err = msgp.WrapError(err, "Signature") 2218 return 2219 } 2220 { 2221 var zb0002 uint8 2222 zb0002, err = dc.ReadUint8() 2223 if err != nil { 2224 err = msgp.WrapError(err, "Type") 2225 return 2226 } 2227 z.Type = VersionType(zb0002) 2228 } 2229 { 2230 var zb0003 uint8 2231 zb0003, err = dc.ReadUint8() 2232 if err != nil { 2233 err = msgp.WrapError(err, "Flags") 2234 return 2235 } 2236 z.Flags = xlFlags(zb0003) 2237 } 2238 return 2239 } 2240 2241 // EncodeMsg implements msgp.Encodable 2242 func (z *xlMetaV2VersionHeader) EncodeMsg(en *msgp.Writer) (err error) { 2243 // array header, size 5 2244 err = en.Append(0x95) 2245 if err != nil { 2246 return 2247 } 2248 err = en.WriteBytes((z.VersionID)[:]) 2249 if err != nil { 2250 err = msgp.WrapError(err, "VersionID") 2251 return 2252 } 2253 err = en.WriteInt64(z.ModTime) 2254 if err != nil { 2255 err = msgp.WrapError(err, "ModTime") 2256 return 2257 } 2258 err = en.WriteBytes((z.Signature)[:]) 2259 if err != nil { 2260 err = msgp.WrapError(err, "Signature") 2261 return 2262 } 2263 err = en.WriteUint8(uint8(z.Type)) 2264 if err != nil { 2265 err = msgp.WrapError(err, "Type") 2266 return 2267 } 2268 err = en.WriteUint8(uint8(z.Flags)) 2269 if err != nil { 2270 err = msgp.WrapError(err, "Flags") 2271 return 2272 } 2273 return 2274 } 2275 2276 // MarshalMsg implements msgp.Marshaler 2277 func (z *xlMetaV2VersionHeader) MarshalMsg(b []byte) (o []byte, err error) { 2278 o = msgp.Require(b, z.Msgsize()) 2279 // array header, size 5 2280 o = append(o, 0x95) 2281 o = msgp.AppendBytes(o, (z.VersionID)[:]) 2282 o = msgp.AppendInt64(o, z.ModTime) 2283 o = msgp.AppendBytes(o, (z.Signature)[:]) 2284 o = msgp.AppendUint8(o, uint8(z.Type)) 2285 o = msgp.AppendUint8(o, uint8(z.Flags)) 2286 return 2287 } 2288 2289 // UnmarshalMsg implements msgp.Unmarshaler 2290 func (z *xlMetaV2VersionHeader) UnmarshalMsg(bts []byte) (o []byte, err error) { 2291 var zb0001 uint32 2292 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 2293 if err != nil { 2294 err = msgp.WrapError(err) 2295 return 2296 } 2297 if zb0001 != 5 { 2298 err = msgp.ArrayError{Wanted: 5, Got: zb0001} 2299 return 2300 } 2301 bts, err = msgp.ReadExactBytes(bts, (z.VersionID)[:]) 2302 if err != nil { 2303 err = msgp.WrapError(err, "VersionID") 2304 return 2305 } 2306 z.ModTime, bts, err = msgp.ReadInt64Bytes(bts) 2307 if err != nil { 2308 err = msgp.WrapError(err, "ModTime") 2309 return 2310 } 2311 bts, err = msgp.ReadExactBytes(bts, (z.Signature)[:]) 2312 if err != nil { 2313 err = msgp.WrapError(err, "Signature") 2314 return 2315 } 2316 { 2317 var zb0002 uint8 2318 zb0002, bts, err = msgp.ReadUint8Bytes(bts) 2319 if err != nil { 2320 err = msgp.WrapError(err, "Type") 2321 return 2322 } 2323 z.Type = VersionType(zb0002) 2324 } 2325 { 2326 var zb0003 uint8 2327 zb0003, bts, err = msgp.ReadUint8Bytes(bts) 2328 if err != nil { 2329 err = msgp.WrapError(err, "Flags") 2330 return 2331 } 2332 z.Flags = xlFlags(zb0003) 2333 } 2334 o = bts 2335 return 2336 } 2337 2338 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 2339 func (z *xlMetaV2VersionHeader) Msgsize() (s int) { 2340 s = 1 + msgp.ArrayHeaderSize + (16 * (msgp.ByteSize)) + msgp.Int64Size + msgp.ArrayHeaderSize + (4 * (msgp.ByteSize)) + msgp.Uint8Size + msgp.Uint8Size 2341 return 2342 }