[#209] pkg/object: Support splitID field in SDK library

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-11-24 20:15:12 +03:00 committed by Alex Vanin
parent b9778464b9
commit 6b0bd42f25
3 changed files with 34 additions and 0 deletions

View file

@ -251,6 +251,21 @@ func (o *rwObject) setChildren(v ...*ID) {
})
}
// SplitID return split identity of split object. If object is not split
// returns nil.
func (o *rwObject) SplitID() []byte {
return (*object.Object)(o).
GetHeader().
GetSplit().
GetSplitID()
}
func (o *rwObject) setSplitID(id []byte) {
o.setSplitFields(func(split *object.SplitHeader) {
split.SetSplitID(id)
})
}
// ParentID returns identifier of the parent object.
func (o *rwObject) ParentID() *ID {
return NewIDFromV2(