forked from TrueCloudLab/frostfs-node
[#1454] Upgrade NeoFS SDK Go module with new IDs
Core changes: * avoid package-colliding variable naming * avoid using pointers to IDs where unnecessary * avoid using `idSDK` import alias pattern * use `EncodeToString` for protocol string calculation and `String` for printing Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
cc6209e8a0
commit
1c30414a6c
218 changed files with 2095 additions and 2521 deletions
|
@ -7,12 +7,12 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/util"
|
||||
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
||||
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
)
|
||||
|
||||
// HeadPrm groups the parameters of Head operation.
|
||||
type HeadPrm struct {
|
||||
addr *addressSDK.Address
|
||||
addr oid.Address
|
||||
raw bool
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ type HeadRes struct {
|
|||
// WithAddress is a Head option to set the address of the requested object.
|
||||
//
|
||||
// Option is required.
|
||||
func (p *HeadPrm) WithAddress(addr *addressSDK.Address) *HeadPrm {
|
||||
func (p *HeadPrm) WithAddress(addr oid.Address) *HeadPrm {
|
||||
if p != nil {
|
||||
p.addr = addr
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ func (e *StorageEngine) head(prm *HeadPrm) (*HeadRes, error) {
|
|||
}
|
||||
|
||||
// Head reads object header from local storage by provided address.
|
||||
func Head(storage *StorageEngine, addr *addressSDK.Address) (*objectSDK.Object, error) {
|
||||
func Head(storage *StorageEngine, addr oid.Address) (*objectSDK.Object, error) {
|
||||
res, err := storage.Head(new(HeadPrm).
|
||||
WithAddress(addr),
|
||||
)
|
||||
|
@ -153,7 +153,7 @@ func Head(storage *StorageEngine, addr *addressSDK.Address) (*objectSDK.Object,
|
|||
|
||||
// HeadRaw reads object header from local storage by provided address and raw
|
||||
// flag.
|
||||
func HeadRaw(storage *StorageEngine, addr *addressSDK.Address, raw bool) (*objectSDK.Object, error) {
|
||||
func HeadRaw(storage *StorageEngine, addr oid.Address, raw bool) (*objectSDK.Object, error) {
|
||||
res, err := storage.Head(new(HeadPrm).
|
||||
WithAddress(addr).
|
||||
WithRaw(raw),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue