[#33] core/object: Add to-SDK object converting method

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-21 17:25:03 +03:00 committed by Alex Vanin
parent 3d25d6c217
commit d3349a293a

View file

@ -28,6 +28,15 @@ func (o *Object) Address() *object.Address {
return nil return nil
} }
// SDK returns NeoFS SDK object instance.
func (o *Object) SDK() *object.Object {
if o != nil {
return o.Object
}
return nil
}
// NewFromV2 constructs Object instance from v2 Object message. // NewFromV2 constructs Object instance from v2 Object message.
func NewFromV2(obj *objectV2.Object) *Object { func NewFromV2(obj *objectV2.Object) *Object {
return &Object{ return &Object{