forked from TrueCloudLab/frostfs-api-go
[#97] object: Refactor Patch related structs
* Add getters and setters for related types; * Fix unit-tests. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
8ce8cd6ec2
commit
8609f29a60
4 changed files with 111 additions and 39 deletions
|
@ -1367,12 +1367,12 @@ func (r *PatchRequestBody) StableMarshal(buf []byte) []byte {
|
|||
}
|
||||
|
||||
var offset int
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyAddrField, buf[offset:], r.Address)
|
||||
for i := range r.NewAttributes {
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyNewAttrsField, buf[offset:], &r.NewAttributes[i])
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyAddrField, buf[offset:], r.address)
|
||||
for i := range r.newAttributes {
|
||||
offset += proto.NestedStructureMarshal(patchRequestBodyNewAttrsField, buf[offset:], &r.newAttributes[i])
|
||||
}
|
||||
offset += proto.BoolMarshal(patchRequestBodyReplaceAttrField, buf[offset:], r.ReplaceAttributes)
|
||||
proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.Patch)
|
||||
offset += proto.BoolMarshal(patchRequestBodyReplaceAttrField, buf[offset:], r.replaceAttributes)
|
||||
proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.patch)
|
||||
|
||||
return buf
|
||||
}
|
||||
|
@ -1383,12 +1383,12 @@ func (r *PatchRequestBody) StableSize() int {
|
|||
}
|
||||
|
||||
var size int
|
||||
size += proto.NestedStructureSize(patchRequestBodyAddrField, r.Address)
|
||||
for i := range r.NewAttributes {
|
||||
size += proto.NestedStructureSize(patchRequestBodyNewAttrsField, &r.NewAttributes[i])
|
||||
size += proto.NestedStructureSize(patchRequestBodyAddrField, r.address)
|
||||
for i := range r.newAttributes {
|
||||
size += proto.NestedStructureSize(patchRequestBodyNewAttrsField, &r.newAttributes[i])
|
||||
}
|
||||
size += proto.BoolSize(patchRequestBodyReplaceAttrField, r.ReplaceAttributes)
|
||||
size += proto.NestedStructureSize(patchRequestBodyPatchField, r.Patch)
|
||||
size += proto.BoolSize(patchRequestBodyReplaceAttrField, r.replaceAttributes)
|
||||
size += proto.NestedStructureSize(patchRequestBodyPatchField, r.patch)
|
||||
|
||||
return size
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue