Port ListBuckets to websockets layer & some cleanup (#19199)

This commit is contained in:
Klaus Post
2024-03-08 20:08:18 +01:00
committed by GitHub
parent 650efc2e96
commit 51f62a8da3
15 changed files with 2783 additions and 184 deletions

View File

@@ -22,6 +22,9 @@ package replication
// StatusType of Replication for x-amz-replication-status header
type StatusType string
// Type - replication type enum
type Type int
const (
// Pending - replication is pending.
Pending StatusType = "PENDING"

View File

@@ -57,3 +57,55 @@ func (z StatusType) Msgsize() (s int) {
s = msgp.StringPrefixSize + len(string(z))
return
}
// DecodeMsg implements msgp.Decodable
func (z *Type) DecodeMsg(dc *msgp.Reader) (err error) {
{
var zb0001 int
zb0001, err = dc.ReadInt()
if err != nil {
err = msgp.WrapError(err)
return
}
(*z) = Type(zb0001)
}
return
}
// EncodeMsg implements msgp.Encodable
func (z Type) EncodeMsg(en *msgp.Writer) (err error) {
err = en.WriteInt(int(z))
if err != nil {
err = msgp.WrapError(err)
return
}
return
}
// MarshalMsg implements msgp.Marshaler
func (z Type) MarshalMsg(b []byte) (o []byte, err error) {
o = msgp.Require(b, z.Msgsize())
o = msgp.AppendInt(o, int(z))
return
}
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Type) UnmarshalMsg(bts []byte) (o []byte, err error) {
{
var zb0001 int
zb0001, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
(*z) = Type(zb0001)
}
o = bts
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z Type) Msgsize() (s int) {
s = msgp.IntSize
return
}

View File

@@ -118,9 +118,6 @@ func (c Config) Validate(bucket string, sameTarget bool) error {
return nil
}
// Type - replication type enum
type Type int
// Types of replication
const (
UnsetReplicationType Type = 0 + iota