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