[#1214] *: Use single Object type in whole project

Remove `Object` and `RawObject` types from `pkg/core/object` package.
Use `Object` type from NeoFS SDK Go library everywhere. Avoid using the
deprecated elements.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-03-03 17:19:05 +03:00 committed by Alex Vanin
parent 19ad349b27
commit 7ccd1625af
100 changed files with 847 additions and 965 deletions

View file

@ -34,7 +34,7 @@ type execCtx struct {
log *logger.Logger
collectedObject *object.Object
collectedObject *objectSDK.Object
curOff uint64
@ -99,9 +99,9 @@ func (exec execCtx) address() *addressSDK.Address {
return exec.prm.addr
}
func (exec execCtx) isChild(obj *object.Object) bool {
par := obj.GetParent()
return par != nil && equalAddresses(exec.address(), par.Address())
func (exec execCtx) isChild(obj *objectSDK.Object) bool {
par := obj.Parent()
return par != nil && equalAddresses(exec.address(), object.AddressOf(par))
}
func (exec execCtx) key() (*ecdsa.PrivateKey, error) {
@ -178,7 +178,7 @@ func (exec *execCtx) generateTraverser(addr *addressSDK.Address) (*placement.Tra
}
}
func (exec *execCtx) getChild(id *oidSDK.ID, rng *objectSDK.Range, withHdr bool) (*object.Object, bool) {
func (exec *execCtx) getChild(id *oidSDK.ID, rng *objectSDK.Range, withHdr bool) (*objectSDK.Object, bool) {
w := NewSimpleObjectWriter()
p := exec.prm
@ -207,7 +207,7 @@ func (exec *execCtx) getChild(id *oidSDK.ID, rng *objectSDK.Range, withHdr bool)
return child, ok
}
func (exec *execCtx) headChild(id *oidSDK.ID) (*object.Object, bool) {
func (exec *execCtx) headChild(id *oidSDK.ID) (*objectSDK.Object, bool) {
childAddr := addressSDK.NewAddress()
childAddr.SetContainerID(exec.containerID())
childAddr.SetObjectID(id)
@ -288,7 +288,7 @@ func (exec *execCtx) writeCollectedHeader() bool {
}
err := exec.prm.objWriter.WriteHeader(
object.NewRawFromObject(exec.collectedObject).CutPayload().Object(),
exec.collectedObject.CutPayload(),
)
switch {
@ -307,7 +307,7 @@ func (exec *execCtx) writeCollectedHeader() bool {
return exec.status == statusOK
}
func (exec *execCtx) writeObjectPayload(obj *object.Object) bool {
func (exec *execCtx) writeObjectPayload(obj *objectSDK.Object) bool {
if exec.headOnly() {
return true
}