mirror of
https://github.com/minio/minio.git
synced 2024-12-25 22:55:54 -05:00
83ccae6c8b
Fixes #9459
161 lines
3.5 KiB
Go
161 lines
3.5 KiB
Go
package cmd
|
|
|
|
// Code generated by github.com/tinylib/msgp DO NOT EDIT.
|
|
|
|
import (
|
|
"github.com/tinylib/msgp/msgp"
|
|
)
|
|
|
|
// DecodeMsg implements msgp.Decodable
|
|
func (z *bucketMetadata) DecodeMsg(dc *msgp.Reader) (err error) {
|
|
var field []byte
|
|
_ = field
|
|
var zb0001 uint32
|
|
zb0001, err = dc.ReadMapHeader()
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
for zb0001 > 0 {
|
|
zb0001--
|
|
field, err = dc.ReadMapKeyPtr()
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
switch msgp.UnsafeString(field) {
|
|
case "Name":
|
|
z.Name, err = dc.ReadString()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Name")
|
|
return
|
|
}
|
|
case "Created":
|
|
z.Created, err = dc.ReadTime()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Created")
|
|
return
|
|
}
|
|
case "LockEnabled":
|
|
z.LockEnabled, err = dc.ReadBool()
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "LockEnabled")
|
|
return
|
|
}
|
|
default:
|
|
err = dc.Skip()
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
// EncodeMsg implements msgp.Encodable
|
|
func (z bucketMetadata) EncodeMsg(en *msgp.Writer) (err error) {
|
|
// map header, size 3
|
|
// write "Name"
|
|
err = en.Append(0x83, 0xa4, 0x4e, 0x61, 0x6d, 0x65)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteString(z.Name)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Name")
|
|
return
|
|
}
|
|
// write "Created"
|
|
err = en.Append(0xa7, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteTime(z.Created)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Created")
|
|
return
|
|
}
|
|
// write "LockEnabled"
|
|
err = en.Append(0xab, 0x4c, 0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = en.WriteBool(z.LockEnabled)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "LockEnabled")
|
|
return
|
|
}
|
|
return
|
|
}
|
|
|
|
// MarshalMsg implements msgp.Marshaler
|
|
func (z bucketMetadata) MarshalMsg(b []byte) (o []byte, err error) {
|
|
o = msgp.Require(b, z.Msgsize())
|
|
// map header, size 3
|
|
// string "Name"
|
|
o = append(o, 0x83, 0xa4, 0x4e, 0x61, 0x6d, 0x65)
|
|
o = msgp.AppendString(o, z.Name)
|
|
// string "Created"
|
|
o = append(o, 0xa7, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64)
|
|
o = msgp.AppendTime(o, z.Created)
|
|
// string "LockEnabled"
|
|
o = append(o, 0xab, 0x4c, 0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64)
|
|
o = msgp.AppendBool(o, z.LockEnabled)
|
|
return
|
|
}
|
|
|
|
// UnmarshalMsg implements msgp.Unmarshaler
|
|
func (z *bucketMetadata) UnmarshalMsg(bts []byte) (o []byte, err error) {
|
|
var field []byte
|
|
_ = field
|
|
var zb0001 uint32
|
|
zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
for zb0001 > 0 {
|
|
zb0001--
|
|
field, bts, err = msgp.ReadMapKeyZC(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
switch msgp.UnsafeString(field) {
|
|
case "Name":
|
|
z.Name, bts, err = msgp.ReadStringBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Name")
|
|
return
|
|
}
|
|
case "Created":
|
|
z.Created, bts, err = msgp.ReadTimeBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "Created")
|
|
return
|
|
}
|
|
case "LockEnabled":
|
|
z.LockEnabled, bts, err = msgp.ReadBoolBytes(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err, "LockEnabled")
|
|
return
|
|
}
|
|
default:
|
|
bts, err = msgp.Skip(bts)
|
|
if err != nil {
|
|
err = msgp.WrapError(err)
|
|
return
|
|
}
|
|
}
|
|
}
|
|
o = bts
|
|
return
|
|
}
|
|
|
|
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
|
|
func (z bucketMetadata) Msgsize() (s int) {
|
|
s = 1 + 5 + msgp.StringPrefixSize + len(z.Name) + 8 + msgp.TimeSize + 12 + msgp.BoolSize
|
|
return
|
|
}
|