2020-08-18 13:48:58 +00:00
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
2022-12-09 11:16:24 +00:00
|
|
|
container "github.com/TrueCloudLab/frostfs-api-go/v2/container/grpc"
|
|
|
|
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message"
|
|
|
|
protoutil "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
2020-08-18 13:48:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
attributeKeyField = 1
|
|
|
|
attributeValueField = 2
|
|
|
|
|
|
|
|
containerVersionField = 1
|
|
|
|
containerOwnerField = 2
|
|
|
|
containerNonceField = 3
|
|
|
|
containerBasicACLField = 4
|
|
|
|
containerAttributesField = 5
|
|
|
|
containerPlacementField = 6
|
|
|
|
|
|
|
|
putReqBodyContainerField = 1
|
|
|
|
putReqBodySignatureField = 2
|
|
|
|
|
|
|
|
putRespBodyIDField = 1
|
|
|
|
|
|
|
|
deleteReqBodyIDField = 1
|
|
|
|
deleteReqBodySignatureField = 2
|
|
|
|
|
|
|
|
getReqBodyIDField = 1
|
|
|
|
|
|
|
|
getRespBodyContainerField = 1
|
2021-05-24 18:18:56 +00:00
|
|
|
getRespBodySignatureField = 2
|
|
|
|
getRespBodyTokenField = 3
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
listReqBodyOwnerField = 1
|
|
|
|
|
|
|
|
listRespBodyIDsField = 1
|
|
|
|
|
|
|
|
setEACLReqBodyTableField = 1
|
|
|
|
setEACLReqBodySignatureField = 2
|
|
|
|
|
|
|
|
getEACLReqBodyIDField = 1
|
|
|
|
|
|
|
|
getEACLRespBodyTableField = 1
|
|
|
|
getEACLRespBodySignatureField = 2
|
2021-05-24 18:18:56 +00:00
|
|
|
getEACLRespBodyTokenField = 3
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-01-26 18:32:33 +00:00
|
|
|
usedSpaceAnnounceEpochField = 1
|
|
|
|
usedSpaceAnnounceCIDField = 2
|
|
|
|
usedSpaceAnnounceUsedSpaceField = 3
|
2021-01-21 14:57:04 +00:00
|
|
|
|
|
|
|
usedSpaceReqBodyAnnouncementsField = 1
|
2020-08-18 13:48:58 +00:00
|
|
|
)
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (a *Attribute) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if a == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, a.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-03-12 12:20:19 +00:00
|
|
|
var offset int
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-03-12 12:20:19 +00:00
|
|
|
offset += protoutil.StringMarshal(attributeKeyField, buf[offset:], a.key)
|
|
|
|
protoutil.StringMarshal(attributeValueField, buf[offset:], a.val)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Attribute) StableSize() (size int) {
|
|
|
|
if a == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.StringSize(attributeKeyField, a.key)
|
|
|
|
size += protoutil.StringSize(attributeValueField, a.val)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
func (a *Attribute) Unmarshal(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.Unmarshal(a, data, new(container.Container_Attribute))
|
2020-11-13 12:14:39 +00:00
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (c *Container) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if c == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, c.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(containerVersionField, buf[offset:], c.version)
|
|
|
|
offset += protoutil.NestedStructureMarshal(containerOwnerField, buf[offset:], c.ownerID)
|
2022-03-12 12:20:19 +00:00
|
|
|
offset += protoutil.BytesMarshal(containerNonceField, buf[offset:], c.nonce)
|
|
|
|
offset += protoutil.UInt32Marshal(containerBasicACLField, buf[offset:], c.basicACL)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
for i := range c.attr {
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(containerAttributesField, buf[offset:], &c.attr[i])
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
protoutil.NestedStructureMarshal(containerPlacementField, buf[offset:], c.policy)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Container) StableSize() (size int) {
|
|
|
|
if c == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(containerVersionField, c.version)
|
|
|
|
size += protoutil.NestedStructureSize(containerOwnerField, c.ownerID)
|
|
|
|
size += protoutil.BytesSize(containerNonceField, c.nonce)
|
|
|
|
size += protoutil.UInt32Size(containerBasicACLField, c.basicACL)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
for i := range c.attr {
|
2022-03-02 08:18:59 +00:00
|
|
|
size += protoutil.NestedStructureSize(containerAttributesField, &c.attr[i])
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(containerPlacementField, c.policy)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:21:34 +00:00
|
|
|
func (c *Container) Unmarshal(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.Unmarshal(c, data, new(container.Container))
|
2020-11-13 12:21:34 +00:00
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *PutRequestBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(putReqBodyContainerField, buf[offset:], r.cnr)
|
|
|
|
protoutil.NestedStructureMarshal(putReqBodySignatureField, buf[offset:], r.sig)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *PutRequestBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(putReqBodyContainerField, r.cnr)
|
|
|
|
size += protoutil.NestedStructureSize(putReqBodySignatureField, r.sig)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutRequestBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.PutRequest_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *PutResponseBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
protoutil.NestedStructureMarshal(putRespBodyIDField, buf, r.cid)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *PutResponseBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(putRespBodyIDField, r.cid)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *PutResponseBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.PutResponse_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *DeleteRequestBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(deleteReqBodyIDField, buf[offset:], r.cid)
|
|
|
|
protoutil.NestedStructureMarshal(deleteReqBodySignatureField, buf[offset:], r.sig)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *DeleteRequestBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(deleteReqBodyIDField, r.cid)
|
|
|
|
size += protoutil.NestedStructureSize(deleteReqBodySignatureField, r.sig)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteRequestBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.DeleteRequest_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *DeleteResponseBody) StableMarshal(buf []byte) []byte {
|
|
|
|
return nil
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *DeleteResponseBody) StableSize() (size int) {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *DeleteResponseBody) Unmarshal([]byte) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *GetRequestBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
protoutil.NestedStructureMarshal(getReqBodyIDField, buf, r.cid)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *GetRequestBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(getReqBodyIDField, r.cid)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetRequestBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.GetRequest_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *GetResponseBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2021-05-24 18:18:56 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(getRespBodyContainerField, buf, r.cnr)
|
|
|
|
offset += protoutil.NestedStructureMarshal(getRespBodySignatureField, buf[offset:], r.sig)
|
|
|
|
protoutil.NestedStructureMarshal(getRespBodyTokenField, buf[offset:], r.token)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *GetResponseBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(getRespBodyContainerField, r.cnr)
|
2021-05-24 18:18:56 +00:00
|
|
|
size += protoutil.NestedStructureSize(getRespBodySignatureField, r.sig)
|
|
|
|
size += protoutil.NestedStructureSize(getRespBodyTokenField, r.token)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetResponseBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.GetResponse_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *ListRequestBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
protoutil.NestedStructureMarshal(listReqBodyOwnerField, buf, r.ownerID)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *ListRequestBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(listReqBodyOwnerField, r.ownerID)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListRequestBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.ListRequest_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *ListResponseBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
for i := range r.cidList {
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(listRespBodyIDsField, buf[offset:], &r.cidList[i])
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *ListResponseBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
for i := range r.cidList {
|
2022-03-02 08:18:59 +00:00
|
|
|
size += protoutil.NestedStructureSize(listRespBodyIDsField, &r.cidList[i])
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *ListResponseBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.ListResponse_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *SetExtendedACLRequestBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(setEACLReqBodyTableField, buf[offset:], r.eacl)
|
|
|
|
protoutil.NestedStructureMarshal(setEACLReqBodySignatureField, buf[offset:], r.sig)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *SetExtendedACLRequestBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(setEACLReqBodyTableField, r.eacl)
|
|
|
|
size += protoutil.NestedStructureSize(setEACLReqBodySignatureField, r.sig)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLRequestBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.SetExtendedACLRequest_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *SetExtendedACLResponseBody) StableMarshal(buf []byte) []byte {
|
|
|
|
return nil
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *SetExtendedACLResponseBody) StableSize() (size int) {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *SetExtendedACLResponseBody) Unmarshal([]byte) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *GetExtendedACLRequestBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
protoutil.NestedStructureMarshal(getEACLReqBodyIDField, buf, r.cid)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *GetExtendedACLRequestBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(getEACLReqBodyIDField, r.cid)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLRequestBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.GetExtendedACLRequest_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *GetExtendedACLResponseBody) StableMarshal(buf []byte) []byte {
|
2020-08-18 13:48:58 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2021-05-24 18:18:56 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(getEACLRespBodyTableField, buf[offset:], r.eacl)
|
|
|
|
offset += protoutil.NestedStructureMarshal(getEACLRespBodySignatureField, buf[offset:], r.sig)
|
|
|
|
protoutil.NestedStructureMarshal(getEACLRespBodyTokenField, buf[offset:], r.token)
|
2021-05-24 18:18:56 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2020-08-18 13:48:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *GetExtendedACLResponseBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:14:39 +00:00
|
|
|
size += protoutil.NestedStructureSize(getEACLRespBodyTableField, r.eacl)
|
|
|
|
size += protoutil.NestedStructureSize(getEACLRespBodySignatureField, r.sig)
|
2021-05-24 18:18:56 +00:00
|
|
|
size += protoutil.NestedStructureSize(getEACLRespBodyTokenField, r.token)
|
2020-08-18 13:48:58 +00:00
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *GetExtendedACLResponseBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.GetExtendedACLResponse_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (a *UsedSpaceAnnouncement) StableMarshal(buf []byte) []byte {
|
2021-01-21 14:57:04 +00:00
|
|
|
if a == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, a.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2022-03-12 12:20:19 +00:00
|
|
|
offset += protoutil.UInt64Marshal(usedSpaceAnnounceEpochField, buf[offset:], a.epoch)
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(usedSpaceAnnounceCIDField, buf[offset:], a.cid)
|
2022-03-12 12:20:19 +00:00
|
|
|
protoutil.UInt64Marshal(usedSpaceAnnounceUsedSpaceField, buf[offset:], a.usedSpace)
|
2021-01-21 14:57:04 +00:00
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *UsedSpaceAnnouncement) StableSize() (size int) {
|
|
|
|
if a == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2021-01-26 18:32:33 +00:00
|
|
|
size += protoutil.UInt64Size(usedSpaceAnnounceEpochField, a.epoch)
|
2021-01-21 14:57:04 +00:00
|
|
|
size += protoutil.NestedStructureSize(usedSpaceAnnounceCIDField, a.cid)
|
|
|
|
size += protoutil.UInt64Size(usedSpaceAnnounceUsedSpaceField, a.usedSpace)
|
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-01-28 13:01:07 +00:00
|
|
|
func (a *UsedSpaceAnnouncement) Unmarshal(data []byte) error {
|
2021-03-12 12:57:23 +00:00
|
|
|
return message.Unmarshal(a, data, new(container.AnnounceUsedSpaceRequest_Body_Announcement))
|
2021-01-28 13:01:07 +00:00
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *AnnounceUsedSpaceRequestBody) StableMarshal(buf []byte) []byte {
|
2021-01-21 14:57:04 +00:00
|
|
|
if r == nil {
|
2022-04-05 08:24:34 +00:00
|
|
|
return []byte{}
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if buf == nil {
|
|
|
|
buf = make([]byte, r.StableSize())
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
var offset int
|
2021-01-21 14:57:04 +00:00
|
|
|
|
|
|
|
for i := range r.announcements {
|
2022-04-05 08:24:34 +00:00
|
|
|
offset += protoutil.NestedStructureMarshal(usedSpaceReqBodyAnnouncementsField, buf[offset:], &r.announcements[i])
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
return buf
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *AnnounceUsedSpaceRequestBody) StableSize() (size int) {
|
|
|
|
if r == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
for i := range r.announcements {
|
2022-03-02 08:18:59 +00:00
|
|
|
size += protoutil.NestedStructureSize(usedSpaceReqBodyAnnouncementsField, &r.announcements[i])
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
func (r *AnnounceUsedSpaceRequestBody) Unmarshal(data []byte) error {
|
|
|
|
return message.Unmarshal(r, data, new(container.AnnounceUsedSpaceRequest_Body))
|
|
|
|
}
|
|
|
|
|
2022-04-05 08:24:34 +00:00
|
|
|
func (r *AnnounceUsedSpaceResponseBody) StableMarshal(buf []byte) []byte {
|
|
|
|
return nil
|
2021-01-21 14:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *AnnounceUsedSpaceResponseBody) StableSize() (size int) {
|
|
|
|
return 0
|
|
|
|
}
|
2021-03-12 12:57:23 +00:00
|
|
|
|
|
|
|
func (r *AnnounceUsedSpaceResponseBody) Unmarshal([]byte) error {
|
|
|
|
return nil
|
|
|
|
}
|