github.com/minio/minio@v0.0.0-20240328213742-3f72439b8a27/cmd/xl-storage-format-v1_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 *BitrotAlgorithm) DecodeMsg(dc *msgp.Reader) (err error) { 11 { 12 var zb0001 uint 13 zb0001, err = dc.ReadUint() 14 if err != nil { 15 err = msgp.WrapError(err) 16 return 17 } 18 (*z) = BitrotAlgorithm(zb0001) 19 } 20 return 21 } 22 23 // EncodeMsg implements msgp.Encodable 24 func (z BitrotAlgorithm) EncodeMsg(en *msgp.Writer) (err error) { 25 err = en.WriteUint(uint(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 BitrotAlgorithm) MarshalMsg(b []byte) (o []byte, err error) { 35 o = msgp.Require(b, z.Msgsize()) 36 o = msgp.AppendUint(o, uint(z)) 37 return 38 } 39 40 // UnmarshalMsg implements msgp.Unmarshaler 41 func (z *BitrotAlgorithm) UnmarshalMsg(bts []byte) (o []byte, err error) { 42 { 43 var zb0001 uint 44 zb0001, bts, err = msgp.ReadUintBytes(bts) 45 if err != nil { 46 err = msgp.WrapError(err) 47 return 48 } 49 (*z) = BitrotAlgorithm(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 BitrotAlgorithm) Msgsize() (s int) { 57 s = msgp.UintSize 58 return 59 } 60 61 // DecodeMsg implements msgp.Decodable 62 func (z *ChecksumInfo) DecodeMsg(dc *msgp.Reader) (err error) { 63 var field []byte 64 _ = field 65 var zb0001 uint32 66 zb0001, err = dc.ReadMapHeader() 67 if err != nil { 68 err = msgp.WrapError(err) 69 return 70 } 71 for zb0001 > 0 { 72 zb0001-- 73 field, err = dc.ReadMapKeyPtr() 74 if err != nil { 75 err = msgp.WrapError(err) 76 return 77 } 78 switch msgp.UnsafeString(field) { 79 case "PartNumber": 80 z.PartNumber, err = dc.ReadInt() 81 if err != nil { 82 err = msgp.WrapError(err, "PartNumber") 83 return 84 } 85 case "Algorithm": 86 { 87 var zb0002 uint 88 zb0002, err = dc.ReadUint() 89 if err != nil { 90 err = msgp.WrapError(err, "Algorithm") 91 return 92 } 93 z.Algorithm = BitrotAlgorithm(zb0002) 94 } 95 case "Hash": 96 z.Hash, err = dc.ReadBytes(z.Hash) 97 if err != nil { 98 err = msgp.WrapError(err, "Hash") 99 return 100 } 101 default: 102 err = dc.Skip() 103 if err != nil { 104 err = msgp.WrapError(err) 105 return 106 } 107 } 108 } 109 return 110 } 111 112 // EncodeMsg implements msgp.Encodable 113 func (z *ChecksumInfo) EncodeMsg(en *msgp.Writer) (err error) { 114 // map header, size 3 115 // write "PartNumber" 116 err = en.Append(0x83, 0xaa, 0x50, 0x61, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72) 117 if err != nil { 118 return 119 } 120 err = en.WriteInt(z.PartNumber) 121 if err != nil { 122 err = msgp.WrapError(err, "PartNumber") 123 return 124 } 125 // write "Algorithm" 126 err = en.Append(0xa9, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d) 127 if err != nil { 128 return 129 } 130 err = en.WriteUint(uint(z.Algorithm)) 131 if err != nil { 132 err = msgp.WrapError(err, "Algorithm") 133 return 134 } 135 // write "Hash" 136 err = en.Append(0xa4, 0x48, 0x61, 0x73, 0x68) 137 if err != nil { 138 return 139 } 140 err = en.WriteBytes(z.Hash) 141 if err != nil { 142 err = msgp.WrapError(err, "Hash") 143 return 144 } 145 return 146 } 147 148 // MarshalMsg implements msgp.Marshaler 149 func (z *ChecksumInfo) MarshalMsg(b []byte) (o []byte, err error) { 150 o = msgp.Require(b, z.Msgsize()) 151 // map header, size 3 152 // string "PartNumber" 153 o = append(o, 0x83, 0xaa, 0x50, 0x61, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72) 154 o = msgp.AppendInt(o, z.PartNumber) 155 // string "Algorithm" 156 o = append(o, 0xa9, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d) 157 o = msgp.AppendUint(o, uint(z.Algorithm)) 158 // string "Hash" 159 o = append(o, 0xa4, 0x48, 0x61, 0x73, 0x68) 160 o = msgp.AppendBytes(o, z.Hash) 161 return 162 } 163 164 // UnmarshalMsg implements msgp.Unmarshaler 165 func (z *ChecksumInfo) UnmarshalMsg(bts []byte) (o []byte, err error) { 166 var field []byte 167 _ = field 168 var zb0001 uint32 169 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 170 if err != nil { 171 err = msgp.WrapError(err) 172 return 173 } 174 for zb0001 > 0 { 175 zb0001-- 176 field, bts, err = msgp.ReadMapKeyZC(bts) 177 if err != nil { 178 err = msgp.WrapError(err) 179 return 180 } 181 switch msgp.UnsafeString(field) { 182 case "PartNumber": 183 z.PartNumber, bts, err = msgp.ReadIntBytes(bts) 184 if err != nil { 185 err = msgp.WrapError(err, "PartNumber") 186 return 187 } 188 case "Algorithm": 189 { 190 var zb0002 uint 191 zb0002, bts, err = msgp.ReadUintBytes(bts) 192 if err != nil { 193 err = msgp.WrapError(err, "Algorithm") 194 return 195 } 196 z.Algorithm = BitrotAlgorithm(zb0002) 197 } 198 case "Hash": 199 z.Hash, bts, err = msgp.ReadBytesBytes(bts, z.Hash) 200 if err != nil { 201 err = msgp.WrapError(err, "Hash") 202 return 203 } 204 default: 205 bts, err = msgp.Skip(bts) 206 if err != nil { 207 err = msgp.WrapError(err) 208 return 209 } 210 } 211 } 212 o = bts 213 return 214 } 215 216 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 217 func (z *ChecksumInfo) Msgsize() (s int) { 218 s = 1 + 11 + msgp.IntSize + 10 + msgp.UintSize + 5 + msgp.BytesPrefixSize + len(z.Hash) 219 return 220 } 221 222 // DecodeMsg implements msgp.Decodable 223 func (z *ErasureInfo) DecodeMsg(dc *msgp.Reader) (err error) { 224 var field []byte 225 _ = field 226 var zb0001 uint32 227 zb0001, err = dc.ReadMapHeader() 228 if err != nil { 229 err = msgp.WrapError(err) 230 return 231 } 232 for zb0001 > 0 { 233 zb0001-- 234 field, err = dc.ReadMapKeyPtr() 235 if err != nil { 236 err = msgp.WrapError(err) 237 return 238 } 239 switch msgp.UnsafeString(field) { 240 case "Algorithm": 241 z.Algorithm, err = dc.ReadString() 242 if err != nil { 243 err = msgp.WrapError(err, "Algorithm") 244 return 245 } 246 case "DataBlocks": 247 z.DataBlocks, err = dc.ReadInt() 248 if err != nil { 249 err = msgp.WrapError(err, "DataBlocks") 250 return 251 } 252 case "ParityBlocks": 253 z.ParityBlocks, err = dc.ReadInt() 254 if err != nil { 255 err = msgp.WrapError(err, "ParityBlocks") 256 return 257 } 258 case "BlockSize": 259 z.BlockSize, err = dc.ReadInt64() 260 if err != nil { 261 err = msgp.WrapError(err, "BlockSize") 262 return 263 } 264 case "Index": 265 z.Index, err = dc.ReadInt() 266 if err != nil { 267 err = msgp.WrapError(err, "Index") 268 return 269 } 270 case "Distribution": 271 var zb0002 uint32 272 zb0002, err = dc.ReadArrayHeader() 273 if err != nil { 274 err = msgp.WrapError(err, "Distribution") 275 return 276 } 277 if cap(z.Distribution) >= int(zb0002) { 278 z.Distribution = (z.Distribution)[:zb0002] 279 } else { 280 z.Distribution = make([]int, zb0002) 281 } 282 for za0001 := range z.Distribution { 283 z.Distribution[za0001], err = dc.ReadInt() 284 if err != nil { 285 err = msgp.WrapError(err, "Distribution", za0001) 286 return 287 } 288 } 289 case "Checksums": 290 var zb0003 uint32 291 zb0003, err = dc.ReadArrayHeader() 292 if err != nil { 293 err = msgp.WrapError(err, "Checksums") 294 return 295 } 296 if cap(z.Checksums) >= int(zb0003) { 297 z.Checksums = (z.Checksums)[:zb0003] 298 } else { 299 z.Checksums = make([]ChecksumInfo, zb0003) 300 } 301 for za0002 := range z.Checksums { 302 err = z.Checksums[za0002].DecodeMsg(dc) 303 if err != nil { 304 err = msgp.WrapError(err, "Checksums", za0002) 305 return 306 } 307 } 308 default: 309 err = dc.Skip() 310 if err != nil { 311 err = msgp.WrapError(err) 312 return 313 } 314 } 315 } 316 return 317 } 318 319 // EncodeMsg implements msgp.Encodable 320 func (z *ErasureInfo) EncodeMsg(en *msgp.Writer) (err error) { 321 // map header, size 7 322 // write "Algorithm" 323 err = en.Append(0x87, 0xa9, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d) 324 if err != nil { 325 return 326 } 327 err = en.WriteString(z.Algorithm) 328 if err != nil { 329 err = msgp.WrapError(err, "Algorithm") 330 return 331 } 332 // write "DataBlocks" 333 err = en.Append(0xaa, 0x44, 0x61, 0x74, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73) 334 if err != nil { 335 return 336 } 337 err = en.WriteInt(z.DataBlocks) 338 if err != nil { 339 err = msgp.WrapError(err, "DataBlocks") 340 return 341 } 342 // write "ParityBlocks" 343 err = en.Append(0xac, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73) 344 if err != nil { 345 return 346 } 347 err = en.WriteInt(z.ParityBlocks) 348 if err != nil { 349 err = msgp.WrapError(err, "ParityBlocks") 350 return 351 } 352 // write "BlockSize" 353 err = en.Append(0xa9, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65) 354 if err != nil { 355 return 356 } 357 err = en.WriteInt64(z.BlockSize) 358 if err != nil { 359 err = msgp.WrapError(err, "BlockSize") 360 return 361 } 362 // write "Index" 363 err = en.Append(0xa5, 0x49, 0x6e, 0x64, 0x65, 0x78) 364 if err != nil { 365 return 366 } 367 err = en.WriteInt(z.Index) 368 if err != nil { 369 err = msgp.WrapError(err, "Index") 370 return 371 } 372 // write "Distribution" 373 err = en.Append(0xac, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e) 374 if err != nil { 375 return 376 } 377 err = en.WriteArrayHeader(uint32(len(z.Distribution))) 378 if err != nil { 379 err = msgp.WrapError(err, "Distribution") 380 return 381 } 382 for za0001 := range z.Distribution { 383 err = en.WriteInt(z.Distribution[za0001]) 384 if err != nil { 385 err = msgp.WrapError(err, "Distribution", za0001) 386 return 387 } 388 } 389 // write "Checksums" 390 err = en.Append(0xa9, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73) 391 if err != nil { 392 return 393 } 394 err = en.WriteArrayHeader(uint32(len(z.Checksums))) 395 if err != nil { 396 err = msgp.WrapError(err, "Checksums") 397 return 398 } 399 for za0002 := range z.Checksums { 400 err = z.Checksums[za0002].EncodeMsg(en) 401 if err != nil { 402 err = msgp.WrapError(err, "Checksums", za0002) 403 return 404 } 405 } 406 return 407 } 408 409 // MarshalMsg implements msgp.Marshaler 410 func (z *ErasureInfo) MarshalMsg(b []byte) (o []byte, err error) { 411 o = msgp.Require(b, z.Msgsize()) 412 // map header, size 7 413 // string "Algorithm" 414 o = append(o, 0x87, 0xa9, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d) 415 o = msgp.AppendString(o, z.Algorithm) 416 // string "DataBlocks" 417 o = append(o, 0xaa, 0x44, 0x61, 0x74, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73) 418 o = msgp.AppendInt(o, z.DataBlocks) 419 // string "ParityBlocks" 420 o = append(o, 0xac, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73) 421 o = msgp.AppendInt(o, z.ParityBlocks) 422 // string "BlockSize" 423 o = append(o, 0xa9, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65) 424 o = msgp.AppendInt64(o, z.BlockSize) 425 // string "Index" 426 o = append(o, 0xa5, 0x49, 0x6e, 0x64, 0x65, 0x78) 427 o = msgp.AppendInt(o, z.Index) 428 // string "Distribution" 429 o = append(o, 0xac, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e) 430 o = msgp.AppendArrayHeader(o, uint32(len(z.Distribution))) 431 for za0001 := range z.Distribution { 432 o = msgp.AppendInt(o, z.Distribution[za0001]) 433 } 434 // string "Checksums" 435 o = append(o, 0xa9, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73) 436 o = msgp.AppendArrayHeader(o, uint32(len(z.Checksums))) 437 for za0002 := range z.Checksums { 438 o, err = z.Checksums[za0002].MarshalMsg(o) 439 if err != nil { 440 err = msgp.WrapError(err, "Checksums", za0002) 441 return 442 } 443 } 444 return 445 } 446 447 // UnmarshalMsg implements msgp.Unmarshaler 448 func (z *ErasureInfo) UnmarshalMsg(bts []byte) (o []byte, err error) { 449 var field []byte 450 _ = field 451 var zb0001 uint32 452 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 453 if err != nil { 454 err = msgp.WrapError(err) 455 return 456 } 457 for zb0001 > 0 { 458 zb0001-- 459 field, bts, err = msgp.ReadMapKeyZC(bts) 460 if err != nil { 461 err = msgp.WrapError(err) 462 return 463 } 464 switch msgp.UnsafeString(field) { 465 case "Algorithm": 466 z.Algorithm, bts, err = msgp.ReadStringBytes(bts) 467 if err != nil { 468 err = msgp.WrapError(err, "Algorithm") 469 return 470 } 471 case "DataBlocks": 472 z.DataBlocks, bts, err = msgp.ReadIntBytes(bts) 473 if err != nil { 474 err = msgp.WrapError(err, "DataBlocks") 475 return 476 } 477 case "ParityBlocks": 478 z.ParityBlocks, bts, err = msgp.ReadIntBytes(bts) 479 if err != nil { 480 err = msgp.WrapError(err, "ParityBlocks") 481 return 482 } 483 case "BlockSize": 484 z.BlockSize, bts, err = msgp.ReadInt64Bytes(bts) 485 if err != nil { 486 err = msgp.WrapError(err, "BlockSize") 487 return 488 } 489 case "Index": 490 z.Index, bts, err = msgp.ReadIntBytes(bts) 491 if err != nil { 492 err = msgp.WrapError(err, "Index") 493 return 494 } 495 case "Distribution": 496 var zb0002 uint32 497 zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) 498 if err != nil { 499 err = msgp.WrapError(err, "Distribution") 500 return 501 } 502 if cap(z.Distribution) >= int(zb0002) { 503 z.Distribution = (z.Distribution)[:zb0002] 504 } else { 505 z.Distribution = make([]int, zb0002) 506 } 507 for za0001 := range z.Distribution { 508 z.Distribution[za0001], bts, err = msgp.ReadIntBytes(bts) 509 if err != nil { 510 err = msgp.WrapError(err, "Distribution", za0001) 511 return 512 } 513 } 514 case "Checksums": 515 var zb0003 uint32 516 zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) 517 if err != nil { 518 err = msgp.WrapError(err, "Checksums") 519 return 520 } 521 if cap(z.Checksums) >= int(zb0003) { 522 z.Checksums = (z.Checksums)[:zb0003] 523 } else { 524 z.Checksums = make([]ChecksumInfo, zb0003) 525 } 526 for za0002 := range z.Checksums { 527 bts, err = z.Checksums[za0002].UnmarshalMsg(bts) 528 if err != nil { 529 err = msgp.WrapError(err, "Checksums", za0002) 530 return 531 } 532 } 533 default: 534 bts, err = msgp.Skip(bts) 535 if err != nil { 536 err = msgp.WrapError(err) 537 return 538 } 539 } 540 } 541 o = bts 542 return 543 } 544 545 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 546 func (z *ErasureInfo) Msgsize() (s int) { 547 s = 1 + 10 + msgp.StringPrefixSize + len(z.Algorithm) + 11 + msgp.IntSize + 13 + msgp.IntSize + 10 + msgp.Int64Size + 6 + msgp.IntSize + 13 + msgp.ArrayHeaderSize + (len(z.Distribution) * (msgp.IntSize)) + 10 + msgp.ArrayHeaderSize 548 for za0002 := range z.Checksums { 549 s += z.Checksums[za0002].Msgsize() 550 } 551 return 552 } 553 554 // DecodeMsg implements msgp.Decodable 555 func (z *ObjectPartInfo) DecodeMsg(dc *msgp.Reader) (err error) { 556 var field []byte 557 _ = field 558 var zb0001 uint32 559 zb0001, err = dc.ReadMapHeader() 560 if err != nil { 561 err = msgp.WrapError(err) 562 return 563 } 564 for zb0001 > 0 { 565 zb0001-- 566 field, err = dc.ReadMapKeyPtr() 567 if err != nil { 568 err = msgp.WrapError(err) 569 return 570 } 571 switch msgp.UnsafeString(field) { 572 case "ETag": 573 z.ETag, err = dc.ReadString() 574 if err != nil { 575 err = msgp.WrapError(err, "ETag") 576 return 577 } 578 case "Number": 579 z.Number, err = dc.ReadInt() 580 if err != nil { 581 err = msgp.WrapError(err, "Number") 582 return 583 } 584 case "Size": 585 z.Size, err = dc.ReadInt64() 586 if err != nil { 587 err = msgp.WrapError(err, "Size") 588 return 589 } 590 case "ActualSize": 591 z.ActualSize, err = dc.ReadInt64() 592 if err != nil { 593 err = msgp.WrapError(err, "ActualSize") 594 return 595 } 596 case "ModTime": 597 z.ModTime, err = dc.ReadTime() 598 if err != nil { 599 err = msgp.WrapError(err, "ModTime") 600 return 601 } 602 case "index": 603 z.Index, err = dc.ReadBytes(z.Index) 604 if err != nil { 605 err = msgp.WrapError(err, "Index") 606 return 607 } 608 case "crc": 609 var zb0002 uint32 610 zb0002, err = dc.ReadMapHeader() 611 if err != nil { 612 err = msgp.WrapError(err, "Checksums") 613 return 614 } 615 if z.Checksums == nil { 616 z.Checksums = make(map[string]string, zb0002) 617 } else if len(z.Checksums) > 0 { 618 for key := range z.Checksums { 619 delete(z.Checksums, key) 620 } 621 } 622 for zb0002 > 0 { 623 zb0002-- 624 var za0001 string 625 var za0002 string 626 za0001, err = dc.ReadString() 627 if err != nil { 628 err = msgp.WrapError(err, "Checksums") 629 return 630 } 631 za0002, err = dc.ReadString() 632 if err != nil { 633 err = msgp.WrapError(err, "Checksums", za0001) 634 return 635 } 636 z.Checksums[za0001] = za0002 637 } 638 default: 639 err = dc.Skip() 640 if err != nil { 641 err = msgp.WrapError(err) 642 return 643 } 644 } 645 } 646 return 647 } 648 649 // EncodeMsg implements msgp.Encodable 650 func (z *ObjectPartInfo) EncodeMsg(en *msgp.Writer) (err error) { 651 // check for omitted fields 652 zb0001Len := uint32(7) 653 var zb0001Mask uint8 /* 7 bits */ 654 _ = zb0001Mask 655 if z.Index == nil { 656 zb0001Len-- 657 zb0001Mask |= 0x20 658 } 659 if z.Checksums == nil { 660 zb0001Len-- 661 zb0001Mask |= 0x40 662 } 663 // variable map header, size zb0001Len 664 err = en.Append(0x80 | uint8(zb0001Len)) 665 if err != nil { 666 return 667 } 668 if zb0001Len == 0 { 669 return 670 } 671 // write "ETag" 672 err = en.Append(0xa4, 0x45, 0x54, 0x61, 0x67) 673 if err != nil { 674 return 675 } 676 err = en.WriteString(z.ETag) 677 if err != nil { 678 err = msgp.WrapError(err, "ETag") 679 return 680 } 681 // write "Number" 682 err = en.Append(0xa6, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72) 683 if err != nil { 684 return 685 } 686 err = en.WriteInt(z.Number) 687 if err != nil { 688 err = msgp.WrapError(err, "Number") 689 return 690 } 691 // write "Size" 692 err = en.Append(0xa4, 0x53, 0x69, 0x7a, 0x65) 693 if err != nil { 694 return 695 } 696 err = en.WriteInt64(z.Size) 697 if err != nil { 698 err = msgp.WrapError(err, "Size") 699 return 700 } 701 // write "ActualSize" 702 err = en.Append(0xaa, 0x41, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) 703 if err != nil { 704 return 705 } 706 err = en.WriteInt64(z.ActualSize) 707 if err != nil { 708 err = msgp.WrapError(err, "ActualSize") 709 return 710 } 711 // write "ModTime" 712 err = en.Append(0xa7, 0x4d, 0x6f, 0x64, 0x54, 0x69, 0x6d, 0x65) 713 if err != nil { 714 return 715 } 716 err = en.WriteTime(z.ModTime) 717 if err != nil { 718 err = msgp.WrapError(err, "ModTime") 719 return 720 } 721 if (zb0001Mask & 0x20) == 0 { // if not omitted 722 // write "index" 723 err = en.Append(0xa5, 0x69, 0x6e, 0x64, 0x65, 0x78) 724 if err != nil { 725 return 726 } 727 err = en.WriteBytes(z.Index) 728 if err != nil { 729 err = msgp.WrapError(err, "Index") 730 return 731 } 732 } 733 if (zb0001Mask & 0x40) == 0 { // if not omitted 734 // write "crc" 735 err = en.Append(0xa3, 0x63, 0x72, 0x63) 736 if err != nil { 737 return 738 } 739 err = en.WriteMapHeader(uint32(len(z.Checksums))) 740 if err != nil { 741 err = msgp.WrapError(err, "Checksums") 742 return 743 } 744 for za0001, za0002 := range z.Checksums { 745 err = en.WriteString(za0001) 746 if err != nil { 747 err = msgp.WrapError(err, "Checksums") 748 return 749 } 750 err = en.WriteString(za0002) 751 if err != nil { 752 err = msgp.WrapError(err, "Checksums", za0001) 753 return 754 } 755 } 756 } 757 return 758 } 759 760 // MarshalMsg implements msgp.Marshaler 761 func (z *ObjectPartInfo) MarshalMsg(b []byte) (o []byte, err error) { 762 o = msgp.Require(b, z.Msgsize()) 763 // check for omitted fields 764 zb0001Len := uint32(7) 765 var zb0001Mask uint8 /* 7 bits */ 766 _ = zb0001Mask 767 if z.Index == nil { 768 zb0001Len-- 769 zb0001Mask |= 0x20 770 } 771 if z.Checksums == nil { 772 zb0001Len-- 773 zb0001Mask |= 0x40 774 } 775 // variable map header, size zb0001Len 776 o = append(o, 0x80|uint8(zb0001Len)) 777 if zb0001Len == 0 { 778 return 779 } 780 // string "ETag" 781 o = append(o, 0xa4, 0x45, 0x54, 0x61, 0x67) 782 o = msgp.AppendString(o, z.ETag) 783 // string "Number" 784 o = append(o, 0xa6, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72) 785 o = msgp.AppendInt(o, z.Number) 786 // string "Size" 787 o = append(o, 0xa4, 0x53, 0x69, 0x7a, 0x65) 788 o = msgp.AppendInt64(o, z.Size) 789 // string "ActualSize" 790 o = append(o, 0xaa, 0x41, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) 791 o = msgp.AppendInt64(o, z.ActualSize) 792 // string "ModTime" 793 o = append(o, 0xa7, 0x4d, 0x6f, 0x64, 0x54, 0x69, 0x6d, 0x65) 794 o = msgp.AppendTime(o, z.ModTime) 795 if (zb0001Mask & 0x20) == 0 { // if not omitted 796 // string "index" 797 o = append(o, 0xa5, 0x69, 0x6e, 0x64, 0x65, 0x78) 798 o = msgp.AppendBytes(o, z.Index) 799 } 800 if (zb0001Mask & 0x40) == 0 { // if not omitted 801 // string "crc" 802 o = append(o, 0xa3, 0x63, 0x72, 0x63) 803 o = msgp.AppendMapHeader(o, uint32(len(z.Checksums))) 804 for za0001, za0002 := range z.Checksums { 805 o = msgp.AppendString(o, za0001) 806 o = msgp.AppendString(o, za0002) 807 } 808 } 809 return 810 } 811 812 // UnmarshalMsg implements msgp.Unmarshaler 813 func (z *ObjectPartInfo) UnmarshalMsg(bts []byte) (o []byte, err error) { 814 var field []byte 815 _ = field 816 var zb0001 uint32 817 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 818 if err != nil { 819 err = msgp.WrapError(err) 820 return 821 } 822 for zb0001 > 0 { 823 zb0001-- 824 field, bts, err = msgp.ReadMapKeyZC(bts) 825 if err != nil { 826 err = msgp.WrapError(err) 827 return 828 } 829 switch msgp.UnsafeString(field) { 830 case "ETag": 831 z.ETag, bts, err = msgp.ReadStringBytes(bts) 832 if err != nil { 833 err = msgp.WrapError(err, "ETag") 834 return 835 } 836 case "Number": 837 z.Number, bts, err = msgp.ReadIntBytes(bts) 838 if err != nil { 839 err = msgp.WrapError(err, "Number") 840 return 841 } 842 case "Size": 843 z.Size, bts, err = msgp.ReadInt64Bytes(bts) 844 if err != nil { 845 err = msgp.WrapError(err, "Size") 846 return 847 } 848 case "ActualSize": 849 z.ActualSize, bts, err = msgp.ReadInt64Bytes(bts) 850 if err != nil { 851 err = msgp.WrapError(err, "ActualSize") 852 return 853 } 854 case "ModTime": 855 z.ModTime, bts, err = msgp.ReadTimeBytes(bts) 856 if err != nil { 857 err = msgp.WrapError(err, "ModTime") 858 return 859 } 860 case "index": 861 z.Index, bts, err = msgp.ReadBytesBytes(bts, z.Index) 862 if err != nil { 863 err = msgp.WrapError(err, "Index") 864 return 865 } 866 case "crc": 867 var zb0002 uint32 868 zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) 869 if err != nil { 870 err = msgp.WrapError(err, "Checksums") 871 return 872 } 873 if z.Checksums == nil { 874 z.Checksums = make(map[string]string, zb0002) 875 } else if len(z.Checksums) > 0 { 876 for key := range z.Checksums { 877 delete(z.Checksums, key) 878 } 879 } 880 for zb0002 > 0 { 881 var za0001 string 882 var za0002 string 883 zb0002-- 884 za0001, bts, err = msgp.ReadStringBytes(bts) 885 if err != nil { 886 err = msgp.WrapError(err, "Checksums") 887 return 888 } 889 za0002, bts, err = msgp.ReadStringBytes(bts) 890 if err != nil { 891 err = msgp.WrapError(err, "Checksums", za0001) 892 return 893 } 894 z.Checksums[za0001] = za0002 895 } 896 default: 897 bts, err = msgp.Skip(bts) 898 if err != nil { 899 err = msgp.WrapError(err) 900 return 901 } 902 } 903 } 904 o = bts 905 return 906 } 907 908 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 909 func (z *ObjectPartInfo) Msgsize() (s int) { 910 s = 1 + 5 + msgp.StringPrefixSize + len(z.ETag) + 7 + msgp.IntSize + 5 + msgp.Int64Size + 11 + msgp.Int64Size + 8 + msgp.TimeSize + 6 + msgp.BytesPrefixSize + len(z.Index) + 4 + msgp.MapHeaderSize 911 if z.Checksums != nil { 912 for za0001, za0002 := range z.Checksums { 913 _ = za0002 914 s += msgp.StringPrefixSize + len(za0001) + msgp.StringPrefixSize + len(za0002) 915 } 916 } 917 return 918 } 919 920 // DecodeMsg implements msgp.Decodable 921 func (z *StatInfo) DecodeMsg(dc *msgp.Reader) (err error) { 922 var field []byte 923 _ = field 924 var zb0001 uint32 925 zb0001, err = dc.ReadMapHeader() 926 if err != nil { 927 err = msgp.WrapError(err) 928 return 929 } 930 for zb0001 > 0 { 931 zb0001-- 932 field, err = dc.ReadMapKeyPtr() 933 if err != nil { 934 err = msgp.WrapError(err) 935 return 936 } 937 switch msgp.UnsafeString(field) { 938 case "Size": 939 z.Size, err = dc.ReadInt64() 940 if err != nil { 941 err = msgp.WrapError(err, "Size") 942 return 943 } 944 case "ModTime": 945 z.ModTime, err = dc.ReadTime() 946 if err != nil { 947 err = msgp.WrapError(err, "ModTime") 948 return 949 } 950 case "Name": 951 z.Name, err = dc.ReadString() 952 if err != nil { 953 err = msgp.WrapError(err, "Name") 954 return 955 } 956 case "Dir": 957 z.Dir, err = dc.ReadBool() 958 if err != nil { 959 err = msgp.WrapError(err, "Dir") 960 return 961 } 962 case "Mode": 963 z.Mode, err = dc.ReadUint32() 964 if err != nil { 965 err = msgp.WrapError(err, "Mode") 966 return 967 } 968 default: 969 err = dc.Skip() 970 if err != nil { 971 err = msgp.WrapError(err) 972 return 973 } 974 } 975 } 976 return 977 } 978 979 // EncodeMsg implements msgp.Encodable 980 func (z *StatInfo) EncodeMsg(en *msgp.Writer) (err error) { 981 // map header, size 5 982 // write "Size" 983 err = en.Append(0x85, 0xa4, 0x53, 0x69, 0x7a, 0x65) 984 if err != nil { 985 return 986 } 987 err = en.WriteInt64(z.Size) 988 if err != nil { 989 err = msgp.WrapError(err, "Size") 990 return 991 } 992 // write "ModTime" 993 err = en.Append(0xa7, 0x4d, 0x6f, 0x64, 0x54, 0x69, 0x6d, 0x65) 994 if err != nil { 995 return 996 } 997 err = en.WriteTime(z.ModTime) 998 if err != nil { 999 err = msgp.WrapError(err, "ModTime") 1000 return 1001 } 1002 // write "Name" 1003 err = en.Append(0xa4, 0x4e, 0x61, 0x6d, 0x65) 1004 if err != nil { 1005 return 1006 } 1007 err = en.WriteString(z.Name) 1008 if err != nil { 1009 err = msgp.WrapError(err, "Name") 1010 return 1011 } 1012 // write "Dir" 1013 err = en.Append(0xa3, 0x44, 0x69, 0x72) 1014 if err != nil { 1015 return 1016 } 1017 err = en.WriteBool(z.Dir) 1018 if err != nil { 1019 err = msgp.WrapError(err, "Dir") 1020 return 1021 } 1022 // write "Mode" 1023 err = en.Append(0xa4, 0x4d, 0x6f, 0x64, 0x65) 1024 if err != nil { 1025 return 1026 } 1027 err = en.WriteUint32(z.Mode) 1028 if err != nil { 1029 err = msgp.WrapError(err, "Mode") 1030 return 1031 } 1032 return 1033 } 1034 1035 // MarshalMsg implements msgp.Marshaler 1036 func (z *StatInfo) MarshalMsg(b []byte) (o []byte, err error) { 1037 o = msgp.Require(b, z.Msgsize()) 1038 // map header, size 5 1039 // string "Size" 1040 o = append(o, 0x85, 0xa4, 0x53, 0x69, 0x7a, 0x65) 1041 o = msgp.AppendInt64(o, z.Size) 1042 // string "ModTime" 1043 o = append(o, 0xa7, 0x4d, 0x6f, 0x64, 0x54, 0x69, 0x6d, 0x65) 1044 o = msgp.AppendTime(o, z.ModTime) 1045 // string "Name" 1046 o = append(o, 0xa4, 0x4e, 0x61, 0x6d, 0x65) 1047 o = msgp.AppendString(o, z.Name) 1048 // string "Dir" 1049 o = append(o, 0xa3, 0x44, 0x69, 0x72) 1050 o = msgp.AppendBool(o, z.Dir) 1051 // string "Mode" 1052 o = append(o, 0xa4, 0x4d, 0x6f, 0x64, 0x65) 1053 o = msgp.AppendUint32(o, z.Mode) 1054 return 1055 } 1056 1057 // UnmarshalMsg implements msgp.Unmarshaler 1058 func (z *StatInfo) UnmarshalMsg(bts []byte) (o []byte, err error) { 1059 var field []byte 1060 _ = field 1061 var zb0001 uint32 1062 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 1063 if err != nil { 1064 err = msgp.WrapError(err) 1065 return 1066 } 1067 for zb0001 > 0 { 1068 zb0001-- 1069 field, bts, err = msgp.ReadMapKeyZC(bts) 1070 if err != nil { 1071 err = msgp.WrapError(err) 1072 return 1073 } 1074 switch msgp.UnsafeString(field) { 1075 case "Size": 1076 z.Size, bts, err = msgp.ReadInt64Bytes(bts) 1077 if err != nil { 1078 err = msgp.WrapError(err, "Size") 1079 return 1080 } 1081 case "ModTime": 1082 z.ModTime, bts, err = msgp.ReadTimeBytes(bts) 1083 if err != nil { 1084 err = msgp.WrapError(err, "ModTime") 1085 return 1086 } 1087 case "Name": 1088 z.Name, bts, err = msgp.ReadStringBytes(bts) 1089 if err != nil { 1090 err = msgp.WrapError(err, "Name") 1091 return 1092 } 1093 case "Dir": 1094 z.Dir, bts, err = msgp.ReadBoolBytes(bts) 1095 if err != nil { 1096 err = msgp.WrapError(err, "Dir") 1097 return 1098 } 1099 case "Mode": 1100 z.Mode, bts, err = msgp.ReadUint32Bytes(bts) 1101 if err != nil { 1102 err = msgp.WrapError(err, "Mode") 1103 return 1104 } 1105 default: 1106 bts, err = msgp.Skip(bts) 1107 if err != nil { 1108 err = msgp.WrapError(err) 1109 return 1110 } 1111 } 1112 } 1113 o = bts 1114 return 1115 } 1116 1117 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1118 func (z *StatInfo) Msgsize() (s int) { 1119 s = 1 + 5 + msgp.Int64Size + 8 + msgp.TimeSize + 5 + msgp.StringPrefixSize + len(z.Name) + 4 + msgp.BoolSize + 5 + msgp.Uint32Size 1120 return 1121 } 1122 1123 // DecodeMsg implements msgp.Decodable 1124 func (z *checksumInfoJSON) DecodeMsg(dc *msgp.Reader) (err error) { 1125 var field []byte 1126 _ = field 1127 var zb0001 uint32 1128 zb0001, err = dc.ReadMapHeader() 1129 if err != nil { 1130 err = msgp.WrapError(err) 1131 return 1132 } 1133 for zb0001 > 0 { 1134 zb0001-- 1135 field, err = dc.ReadMapKeyPtr() 1136 if err != nil { 1137 err = msgp.WrapError(err) 1138 return 1139 } 1140 switch msgp.UnsafeString(field) { 1141 case "Name": 1142 z.Name, err = dc.ReadString() 1143 if err != nil { 1144 err = msgp.WrapError(err, "Name") 1145 return 1146 } 1147 case "Algorithm": 1148 z.Algorithm, err = dc.ReadString() 1149 if err != nil { 1150 err = msgp.WrapError(err, "Algorithm") 1151 return 1152 } 1153 case "Hash": 1154 z.Hash, err = dc.ReadString() 1155 if err != nil { 1156 err = msgp.WrapError(err, "Hash") 1157 return 1158 } 1159 default: 1160 err = dc.Skip() 1161 if err != nil { 1162 err = msgp.WrapError(err) 1163 return 1164 } 1165 } 1166 } 1167 return 1168 } 1169 1170 // EncodeMsg implements msgp.Encodable 1171 func (z checksumInfoJSON) EncodeMsg(en *msgp.Writer) (err error) { 1172 // map header, size 3 1173 // write "Name" 1174 err = en.Append(0x83, 0xa4, 0x4e, 0x61, 0x6d, 0x65) 1175 if err != nil { 1176 return 1177 } 1178 err = en.WriteString(z.Name) 1179 if err != nil { 1180 err = msgp.WrapError(err, "Name") 1181 return 1182 } 1183 // write "Algorithm" 1184 err = en.Append(0xa9, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d) 1185 if err != nil { 1186 return 1187 } 1188 err = en.WriteString(z.Algorithm) 1189 if err != nil { 1190 err = msgp.WrapError(err, "Algorithm") 1191 return 1192 } 1193 // write "Hash" 1194 err = en.Append(0xa4, 0x48, 0x61, 0x73, 0x68) 1195 if err != nil { 1196 return 1197 } 1198 err = en.WriteString(z.Hash) 1199 if err != nil { 1200 err = msgp.WrapError(err, "Hash") 1201 return 1202 } 1203 return 1204 } 1205 1206 // MarshalMsg implements msgp.Marshaler 1207 func (z checksumInfoJSON) MarshalMsg(b []byte) (o []byte, err error) { 1208 o = msgp.Require(b, z.Msgsize()) 1209 // map header, size 3 1210 // string "Name" 1211 o = append(o, 0x83, 0xa4, 0x4e, 0x61, 0x6d, 0x65) 1212 o = msgp.AppendString(o, z.Name) 1213 // string "Algorithm" 1214 o = append(o, 0xa9, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d) 1215 o = msgp.AppendString(o, z.Algorithm) 1216 // string "Hash" 1217 o = append(o, 0xa4, 0x48, 0x61, 0x73, 0x68) 1218 o = msgp.AppendString(o, z.Hash) 1219 return 1220 } 1221 1222 // UnmarshalMsg implements msgp.Unmarshaler 1223 func (z *checksumInfoJSON) UnmarshalMsg(bts []byte) (o []byte, err error) { 1224 var field []byte 1225 _ = field 1226 var zb0001 uint32 1227 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 1228 if err != nil { 1229 err = msgp.WrapError(err) 1230 return 1231 } 1232 for zb0001 > 0 { 1233 zb0001-- 1234 field, bts, err = msgp.ReadMapKeyZC(bts) 1235 if err != nil { 1236 err = msgp.WrapError(err) 1237 return 1238 } 1239 switch msgp.UnsafeString(field) { 1240 case "Name": 1241 z.Name, bts, err = msgp.ReadStringBytes(bts) 1242 if err != nil { 1243 err = msgp.WrapError(err, "Name") 1244 return 1245 } 1246 case "Algorithm": 1247 z.Algorithm, bts, err = msgp.ReadStringBytes(bts) 1248 if err != nil { 1249 err = msgp.WrapError(err, "Algorithm") 1250 return 1251 } 1252 case "Hash": 1253 z.Hash, bts, err = msgp.ReadStringBytes(bts) 1254 if err != nil { 1255 err = msgp.WrapError(err, "Hash") 1256 return 1257 } 1258 default: 1259 bts, err = msgp.Skip(bts) 1260 if err != nil { 1261 err = msgp.WrapError(err) 1262 return 1263 } 1264 } 1265 } 1266 o = bts 1267 return 1268 } 1269 1270 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1271 func (z checksumInfoJSON) Msgsize() (s int) { 1272 s = 1 + 5 + msgp.StringPrefixSize + len(z.Name) + 10 + msgp.StringPrefixSize + len(z.Algorithm) + 5 + msgp.StringPrefixSize + len(z.Hash) 1273 return 1274 } 1275 1276 // DecodeMsg implements msgp.Decodable 1277 func (z *xlMetaV1Object) DecodeMsg(dc *msgp.Reader) (err error) { 1278 var field []byte 1279 _ = field 1280 var zb0001 uint32 1281 zb0001, err = dc.ReadMapHeader() 1282 if err != nil { 1283 err = msgp.WrapError(err) 1284 return 1285 } 1286 for zb0001 > 0 { 1287 zb0001-- 1288 field, err = dc.ReadMapKeyPtr() 1289 if err != nil { 1290 err = msgp.WrapError(err) 1291 return 1292 } 1293 switch msgp.UnsafeString(field) { 1294 case "Version": 1295 z.Version, err = dc.ReadString() 1296 if err != nil { 1297 err = msgp.WrapError(err, "Version") 1298 return 1299 } 1300 case "Format": 1301 z.Format, err = dc.ReadString() 1302 if err != nil { 1303 err = msgp.WrapError(err, "Format") 1304 return 1305 } 1306 case "Stat": 1307 err = z.Stat.DecodeMsg(dc) 1308 if err != nil { 1309 err = msgp.WrapError(err, "Stat") 1310 return 1311 } 1312 case "Erasure": 1313 err = z.Erasure.DecodeMsg(dc) 1314 if err != nil { 1315 err = msgp.WrapError(err, "Erasure") 1316 return 1317 } 1318 case "Minio": 1319 var zb0002 uint32 1320 zb0002, err = dc.ReadMapHeader() 1321 if err != nil { 1322 err = msgp.WrapError(err, "Minio") 1323 return 1324 } 1325 for zb0002 > 0 { 1326 zb0002-- 1327 field, err = dc.ReadMapKeyPtr() 1328 if err != nil { 1329 err = msgp.WrapError(err, "Minio") 1330 return 1331 } 1332 switch msgp.UnsafeString(field) { 1333 case "Release": 1334 z.Minio.Release, err = dc.ReadString() 1335 if err != nil { 1336 err = msgp.WrapError(err, "Minio", "Release") 1337 return 1338 } 1339 default: 1340 err = dc.Skip() 1341 if err != nil { 1342 err = msgp.WrapError(err, "Minio") 1343 return 1344 } 1345 } 1346 } 1347 case "Meta": 1348 var zb0003 uint32 1349 zb0003, err = dc.ReadMapHeader() 1350 if err != nil { 1351 err = msgp.WrapError(err, "Meta") 1352 return 1353 } 1354 if z.Meta == nil { 1355 z.Meta = make(map[string]string, zb0003) 1356 } else if len(z.Meta) > 0 { 1357 for key := range z.Meta { 1358 delete(z.Meta, key) 1359 } 1360 } 1361 for zb0003 > 0 { 1362 zb0003-- 1363 var za0001 string 1364 var za0002 string 1365 za0001, err = dc.ReadString() 1366 if err != nil { 1367 err = msgp.WrapError(err, "Meta") 1368 return 1369 } 1370 za0002, err = dc.ReadString() 1371 if err != nil { 1372 err = msgp.WrapError(err, "Meta", za0001) 1373 return 1374 } 1375 z.Meta[za0001] = za0002 1376 } 1377 case "Parts": 1378 var zb0004 uint32 1379 zb0004, err = dc.ReadArrayHeader() 1380 if err != nil { 1381 err = msgp.WrapError(err, "Parts") 1382 return 1383 } 1384 if cap(z.Parts) >= int(zb0004) { 1385 z.Parts = (z.Parts)[:zb0004] 1386 } else { 1387 z.Parts = make([]ObjectPartInfo, zb0004) 1388 } 1389 for za0003 := range z.Parts { 1390 err = z.Parts[za0003].DecodeMsg(dc) 1391 if err != nil { 1392 err = msgp.WrapError(err, "Parts", za0003) 1393 return 1394 } 1395 } 1396 case "VersionID": 1397 z.VersionID, err = dc.ReadString() 1398 if err != nil { 1399 err = msgp.WrapError(err, "VersionID") 1400 return 1401 } 1402 case "DataDir": 1403 z.DataDir, err = dc.ReadString() 1404 if err != nil { 1405 err = msgp.WrapError(err, "DataDir") 1406 return 1407 } 1408 default: 1409 err = dc.Skip() 1410 if err != nil { 1411 err = msgp.WrapError(err) 1412 return 1413 } 1414 } 1415 } 1416 return 1417 } 1418 1419 // EncodeMsg implements msgp.Encodable 1420 func (z *xlMetaV1Object) EncodeMsg(en *msgp.Writer) (err error) { 1421 // map header, size 9 1422 // write "Version" 1423 err = en.Append(0x89, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) 1424 if err != nil { 1425 return 1426 } 1427 err = en.WriteString(z.Version) 1428 if err != nil { 1429 err = msgp.WrapError(err, "Version") 1430 return 1431 } 1432 // write "Format" 1433 err = en.Append(0xa6, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74) 1434 if err != nil { 1435 return 1436 } 1437 err = en.WriteString(z.Format) 1438 if err != nil { 1439 err = msgp.WrapError(err, "Format") 1440 return 1441 } 1442 // write "Stat" 1443 err = en.Append(0xa4, 0x53, 0x74, 0x61, 0x74) 1444 if err != nil { 1445 return 1446 } 1447 err = z.Stat.EncodeMsg(en) 1448 if err != nil { 1449 err = msgp.WrapError(err, "Stat") 1450 return 1451 } 1452 // write "Erasure" 1453 err = en.Append(0xa7, 0x45, 0x72, 0x61, 0x73, 0x75, 0x72, 0x65) 1454 if err != nil { 1455 return 1456 } 1457 err = z.Erasure.EncodeMsg(en) 1458 if err != nil { 1459 err = msgp.WrapError(err, "Erasure") 1460 return 1461 } 1462 // write "Minio" 1463 err = en.Append(0xa5, 0x4d, 0x69, 0x6e, 0x69, 0x6f) 1464 if err != nil { 1465 return 1466 } 1467 // map header, size 1 1468 // write "Release" 1469 err = en.Append(0x81, 0xa7, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65) 1470 if err != nil { 1471 return 1472 } 1473 err = en.WriteString(z.Minio.Release) 1474 if err != nil { 1475 err = msgp.WrapError(err, "Minio", "Release") 1476 return 1477 } 1478 // write "Meta" 1479 err = en.Append(0xa4, 0x4d, 0x65, 0x74, 0x61) 1480 if err != nil { 1481 return 1482 } 1483 err = en.WriteMapHeader(uint32(len(z.Meta))) 1484 if err != nil { 1485 err = msgp.WrapError(err, "Meta") 1486 return 1487 } 1488 for za0001, za0002 := range z.Meta { 1489 err = en.WriteString(za0001) 1490 if err != nil { 1491 err = msgp.WrapError(err, "Meta") 1492 return 1493 } 1494 err = en.WriteString(za0002) 1495 if err != nil { 1496 err = msgp.WrapError(err, "Meta", za0001) 1497 return 1498 } 1499 } 1500 // write "Parts" 1501 err = en.Append(0xa5, 0x50, 0x61, 0x72, 0x74, 0x73) 1502 if err != nil { 1503 return 1504 } 1505 err = en.WriteArrayHeader(uint32(len(z.Parts))) 1506 if err != nil { 1507 err = msgp.WrapError(err, "Parts") 1508 return 1509 } 1510 for za0003 := range z.Parts { 1511 err = z.Parts[za0003].EncodeMsg(en) 1512 if err != nil { 1513 err = msgp.WrapError(err, "Parts", za0003) 1514 return 1515 } 1516 } 1517 // write "VersionID" 1518 err = en.Append(0xa9, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44) 1519 if err != nil { 1520 return 1521 } 1522 err = en.WriteString(z.VersionID) 1523 if err != nil { 1524 err = msgp.WrapError(err, "VersionID") 1525 return 1526 } 1527 // write "DataDir" 1528 err = en.Append(0xa7, 0x44, 0x61, 0x74, 0x61, 0x44, 0x69, 0x72) 1529 if err != nil { 1530 return 1531 } 1532 err = en.WriteString(z.DataDir) 1533 if err != nil { 1534 err = msgp.WrapError(err, "DataDir") 1535 return 1536 } 1537 return 1538 } 1539 1540 // MarshalMsg implements msgp.Marshaler 1541 func (z *xlMetaV1Object) MarshalMsg(b []byte) (o []byte, err error) { 1542 o = msgp.Require(b, z.Msgsize()) 1543 // map header, size 9 1544 // string "Version" 1545 o = append(o, 0x89, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) 1546 o = msgp.AppendString(o, z.Version) 1547 // string "Format" 1548 o = append(o, 0xa6, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74) 1549 o = msgp.AppendString(o, z.Format) 1550 // string "Stat" 1551 o = append(o, 0xa4, 0x53, 0x74, 0x61, 0x74) 1552 o, err = z.Stat.MarshalMsg(o) 1553 if err != nil { 1554 err = msgp.WrapError(err, "Stat") 1555 return 1556 } 1557 // string "Erasure" 1558 o = append(o, 0xa7, 0x45, 0x72, 0x61, 0x73, 0x75, 0x72, 0x65) 1559 o, err = z.Erasure.MarshalMsg(o) 1560 if err != nil { 1561 err = msgp.WrapError(err, "Erasure") 1562 return 1563 } 1564 // string "Minio" 1565 o = append(o, 0xa5, 0x4d, 0x69, 0x6e, 0x69, 0x6f) 1566 // map header, size 1 1567 // string "Release" 1568 o = append(o, 0x81, 0xa7, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65) 1569 o = msgp.AppendString(o, z.Minio.Release) 1570 // string "Meta" 1571 o = append(o, 0xa4, 0x4d, 0x65, 0x74, 0x61) 1572 o = msgp.AppendMapHeader(o, uint32(len(z.Meta))) 1573 for za0001, za0002 := range z.Meta { 1574 o = msgp.AppendString(o, za0001) 1575 o = msgp.AppendString(o, za0002) 1576 } 1577 // string "Parts" 1578 o = append(o, 0xa5, 0x50, 0x61, 0x72, 0x74, 0x73) 1579 o = msgp.AppendArrayHeader(o, uint32(len(z.Parts))) 1580 for za0003 := range z.Parts { 1581 o, err = z.Parts[za0003].MarshalMsg(o) 1582 if err != nil { 1583 err = msgp.WrapError(err, "Parts", za0003) 1584 return 1585 } 1586 } 1587 // string "VersionID" 1588 o = append(o, 0xa9, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44) 1589 o = msgp.AppendString(o, z.VersionID) 1590 // string "DataDir" 1591 o = append(o, 0xa7, 0x44, 0x61, 0x74, 0x61, 0x44, 0x69, 0x72) 1592 o = msgp.AppendString(o, z.DataDir) 1593 return 1594 } 1595 1596 // UnmarshalMsg implements msgp.Unmarshaler 1597 func (z *xlMetaV1Object) UnmarshalMsg(bts []byte) (o []byte, err error) { 1598 var field []byte 1599 _ = field 1600 var zb0001 uint32 1601 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 1602 if err != nil { 1603 err = msgp.WrapError(err) 1604 return 1605 } 1606 for zb0001 > 0 { 1607 zb0001-- 1608 field, bts, err = msgp.ReadMapKeyZC(bts) 1609 if err != nil { 1610 err = msgp.WrapError(err) 1611 return 1612 } 1613 switch msgp.UnsafeString(field) { 1614 case "Version": 1615 z.Version, bts, err = msgp.ReadStringBytes(bts) 1616 if err != nil { 1617 err = msgp.WrapError(err, "Version") 1618 return 1619 } 1620 case "Format": 1621 z.Format, bts, err = msgp.ReadStringBytes(bts) 1622 if err != nil { 1623 err = msgp.WrapError(err, "Format") 1624 return 1625 } 1626 case "Stat": 1627 bts, err = z.Stat.UnmarshalMsg(bts) 1628 if err != nil { 1629 err = msgp.WrapError(err, "Stat") 1630 return 1631 } 1632 case "Erasure": 1633 bts, err = z.Erasure.UnmarshalMsg(bts) 1634 if err != nil { 1635 err = msgp.WrapError(err, "Erasure") 1636 return 1637 } 1638 case "Minio": 1639 var zb0002 uint32 1640 zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) 1641 if err != nil { 1642 err = msgp.WrapError(err, "Minio") 1643 return 1644 } 1645 for zb0002 > 0 { 1646 zb0002-- 1647 field, bts, err = msgp.ReadMapKeyZC(bts) 1648 if err != nil { 1649 err = msgp.WrapError(err, "Minio") 1650 return 1651 } 1652 switch msgp.UnsafeString(field) { 1653 case "Release": 1654 z.Minio.Release, bts, err = msgp.ReadStringBytes(bts) 1655 if err != nil { 1656 err = msgp.WrapError(err, "Minio", "Release") 1657 return 1658 } 1659 default: 1660 bts, err = msgp.Skip(bts) 1661 if err != nil { 1662 err = msgp.WrapError(err, "Minio") 1663 return 1664 } 1665 } 1666 } 1667 case "Meta": 1668 var zb0003 uint32 1669 zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) 1670 if err != nil { 1671 err = msgp.WrapError(err, "Meta") 1672 return 1673 } 1674 if z.Meta == nil { 1675 z.Meta = make(map[string]string, zb0003) 1676 } else if len(z.Meta) > 0 { 1677 for key := range z.Meta { 1678 delete(z.Meta, key) 1679 } 1680 } 1681 for zb0003 > 0 { 1682 var za0001 string 1683 var za0002 string 1684 zb0003-- 1685 za0001, bts, err = msgp.ReadStringBytes(bts) 1686 if err != nil { 1687 err = msgp.WrapError(err, "Meta") 1688 return 1689 } 1690 za0002, bts, err = msgp.ReadStringBytes(bts) 1691 if err != nil { 1692 err = msgp.WrapError(err, "Meta", za0001) 1693 return 1694 } 1695 z.Meta[za0001] = za0002 1696 } 1697 case "Parts": 1698 var zb0004 uint32 1699 zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) 1700 if err != nil { 1701 err = msgp.WrapError(err, "Parts") 1702 return 1703 } 1704 if cap(z.Parts) >= int(zb0004) { 1705 z.Parts = (z.Parts)[:zb0004] 1706 } else { 1707 z.Parts = make([]ObjectPartInfo, zb0004) 1708 } 1709 for za0003 := range z.Parts { 1710 bts, err = z.Parts[za0003].UnmarshalMsg(bts) 1711 if err != nil { 1712 err = msgp.WrapError(err, "Parts", za0003) 1713 return 1714 } 1715 } 1716 case "VersionID": 1717 z.VersionID, bts, err = msgp.ReadStringBytes(bts) 1718 if err != nil { 1719 err = msgp.WrapError(err, "VersionID") 1720 return 1721 } 1722 case "DataDir": 1723 z.DataDir, bts, err = msgp.ReadStringBytes(bts) 1724 if err != nil { 1725 err = msgp.WrapError(err, "DataDir") 1726 return 1727 } 1728 default: 1729 bts, err = msgp.Skip(bts) 1730 if err != nil { 1731 err = msgp.WrapError(err) 1732 return 1733 } 1734 } 1735 } 1736 o = bts 1737 return 1738 } 1739 1740 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1741 func (z *xlMetaV1Object) Msgsize() (s int) { 1742 s = 1 + 8 + msgp.StringPrefixSize + len(z.Version) + 7 + msgp.StringPrefixSize + len(z.Format) + 5 + z.Stat.Msgsize() + 8 + z.Erasure.Msgsize() + 6 + 1 + 8 + msgp.StringPrefixSize + len(z.Minio.Release) + 5 + msgp.MapHeaderSize 1743 if z.Meta != nil { 1744 for za0001, za0002 := range z.Meta { 1745 _ = za0002 1746 s += msgp.StringPrefixSize + len(za0001) + msgp.StringPrefixSize + len(za0002) 1747 } 1748 } 1749 s += 6 + msgp.ArrayHeaderSize 1750 for za0003 := range z.Parts { 1751 s += z.Parts[za0003].Msgsize() 1752 } 1753 s += 10 + msgp.StringPrefixSize + len(z.VersionID) + 8 + msgp.StringPrefixSize + len(z.DataDir) 1754 return 1755 }