forked from TrueCloudLab/frostfs-api-go
[#168] object: Implement binary/JSON encoders/decoders on Object
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9cdd14841a
commit
9325e22871
7 changed files with 102 additions and 15 deletions
|
@ -37,14 +37,3 @@ func (o *Object) ToV2() *object.Object {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FromBytes restores Object instance from a binary representation.
|
||||
func FromBytes(data []byte) (*Object, error) {
|
||||
oV2 := new(object.Object)
|
||||
|
||||
if err := oV2.StableUnmarshal(data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return NewFromV2(oV2), nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue