forked from TrueCloudLab/frostfs-api-go
[#168] object: Implement binary/JSON encoders/decoders on ShortHeader
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
a684da6118
commit
ce0d70fa02
4 changed files with 59 additions and 4 deletions
|
@ -162,6 +162,17 @@ func (h *ShortHeader) StableSize() (size int) {
|
|||
return size
|
||||
}
|
||||
|
||||
func (h *ShortHeader) Unmarshal(data []byte) error {
|
||||
m := new(object.ShortHeader)
|
||||
if err := goproto.Unmarshal(data, m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*h = *ShortHeaderFromGRPCMessage(m)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *Attribute) StableMarshal(buf []byte) ([]byte, error) {
|
||||
if a == nil {
|
||||
return []byte{}, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue