[#496] node: Fix linter importas
All checks were successful
Build / Build Components (1.20) (pull_request) Successful in 3m52s
Build / Build Components (1.19) (pull_request) Successful in 4m1s
ci/woodpecker/pr/pre-commit Pipeline was successful
Tests and linters / Tests with -race (pull_request) Successful in 5m36s
Tests and linters / Tests (1.20) (pull_request) Successful in 5m55s
Tests and linters / Lint (pull_request) Successful in 14m40s
Tests and linters / Tests (1.19) (pull_request) Successful in 15m29s
ci/woodpecker/push/pre-commit Pipeline was successful

Standardize the alias of the
import frostfs-sdk-go/object as objectSDK.

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2023-07-06 15:36:41 +03:00
parent 4bbe9cc936
commit 033eaf77e1
80 changed files with 444 additions and 443 deletions

View file

@ -14,7 +14,7 @@ import (
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session"
)
@ -77,7 +77,7 @@ type readPrmCommon struct {
commonPrm
}
// SetNetmapEpoch sets the epoch number to be used to locate the object.
// SetNetmapEpoch sets the epoch number to be used to locate the objectSDK.
//
// By default current epoch on the server will be used.
func (x *readPrmCommon) SetNetmapEpoch(_ uint64) {
@ -111,11 +111,11 @@ func (x *GetObjectPrm) SetAddress(addr oid.Address) {
// GetObjectRes groups the resulting values of GetObject operation.
type GetObjectRes struct {
obj *object.Object
obj *objectSDK.Object
}
// Object returns requested object.
func (x GetObjectRes) Object() *object.Object {
// Object returns requested objectSDK.
func (x GetObjectRes) Object() *objectSDK.Object {
return x.obj
}
@ -125,10 +125,10 @@ func (x GetObjectRes) Object() *object.Object {
//
// Returns any error which prevented the operation from completing correctly in error return.
// Returns:
// - error of type *object.SplitInfoError if object raw flag is set and requested object is virtual;
// - error of type *objectSDK.SplitInfoError if object raw flag is set and requested object is virtual;
// - error of type *apistatus.ObjectAlreadyRemoved if the requested object is marked to be removed.
//
// GetObject ignores the provided session if it is not related to the requested object.
// GetObject ignores the provided session if it is not related to the requested objectSDK.
func GetObject(ctx context.Context, prm GetObjectPrm) (*GetObjectRes, error) {
// here we ignore session if it is opened for other object since such
// request will almost definitely fail. The case can occur, for example,
@ -155,7 +155,7 @@ func GetObject(ctx context.Context, prm GetObjectPrm) (*GetObjectRes, error) {
return nil, fmt.Errorf("init object reading: %w", err)
}
var obj object.Object
var obj objectSDK.Object
if !rdr.ReadHeader(&obj) {
res, err := rdr.Close()
@ -210,11 +210,11 @@ func (x *HeadObjectPrm) SetAddress(addr oid.Address) {
// HeadObjectRes groups the resulting values of GetObject operation.
type HeadObjectRes struct {
hdr *object.Object
hdr *objectSDK.Object
}
// Header returns requested object header.
func (x HeadObjectRes) Header() *object.Object {
func (x HeadObjectRes) Header() *objectSDK.Object {
return x.hdr
}
@ -225,10 +225,10 @@ func (x HeadObjectRes) Header() *object.Object {
// Returns any error which prevented the operation from completing correctly in error return.
// Returns:
//
// error of type *object.SplitInfoError if object raw flag is set and requested object is virtual;
// error of type *objectSDK.SplitInfoError if object raw flag is set and requested object is virtual;
// error of type *apistatus.ObjectAlreadyRemoved if the requested object is marked to be removed.
//
// HeadObject ignores the provided session if it is not related to the requested object.
// HeadObject ignores the provided session if it is not related to the requested objectSDK.
func HeadObject(ctx context.Context, prm HeadObjectPrm) (*HeadObjectRes, error) {
if prm.local {
prm.cliPrm.MarkLocal()
@ -255,7 +255,7 @@ func HeadObject(ctx context.Context, prm HeadObjectPrm) (*HeadObjectRes, error)
return nil, fmt.Errorf("read object header from FrostFS: %w", err)
}
var hdr object.Object
var hdr objectSDK.Object
if !cliRes.ReadHeader(&hdr) {
return nil, errors.New("missing object header in the response")
@ -296,7 +296,7 @@ func (x *PayloadRangePrm) SetAddress(addr oid.Address) {
// SetRange range of the object payload to be read.
//
// Required parameter.
func (x *PayloadRangePrm) SetRange(rng *object.Range) {
func (x *PayloadRangePrm) SetRange(rng *objectSDK.Range) {
x.cliPrm.SetOffset(rng.GetOffset())
x.ln = rng.GetLength()
}
@ -323,11 +323,11 @@ const maxInitialBufferSize = 1024 * 1024 // 1 MiB
// Returns any error which prevented the operation from completing correctly in error return.
// Returns:
//
// error of type *object.SplitInfoError if object raw flag is set and requested object is virtual;
// error of type *objectSDK.SplitInfoError if object raw flag is set and requested object is virtual;
// error of type *apistatus.ObjectAlreadyRemoved if the requested object is marked to be removed;
// error of type *apistatus.ObjectOutOfRange if the requested range is too big.
//
// PayloadRange ignores the provided session if it is not related to the requested object.
// PayloadRange ignores the provided session if it is not related to the requested objectSDK.
func PayloadRange(ctx context.Context, prm PayloadRangePrm) (*PayloadRangeRes, error) {
if prm.local {
prm.cliPrm.MarkLocal()
@ -377,13 +377,13 @@ func PayloadRange(ctx context.Context, prm PayloadRangePrm) (*PayloadRangeRes, e
type PutObjectPrm struct {
commonPrm
obj *object.Object
obj *objectSDK.Object
}
// SetObject sets object to be stored.
//
// Required parameter.
func (x *PutObjectPrm) SetObject(obj *object.Object) {
func (x *PutObjectPrm) SetObject(obj *objectSDK.Object) {
x.obj = obj
}
@ -392,7 +392,7 @@ type PutObjectRes struct {
id oid.ID
}
// ID returns identifier of the stored object.
// ID returns identifier of the stored objectSDK.
func (x PutObjectRes) ID() oid.ID {
return x.id
}
@ -464,7 +464,7 @@ func (x *SearchObjectsPrm) SetContainerID(id cid.ID) {
}
// SetFilters sets search filters.
func (x *SearchObjectsPrm) SetFilters(fs object.SearchFilters) {
func (x *SearchObjectsPrm) SetFilters(fs objectSDK.SearchFilters) {
x.cliPrm.SetFilters(fs)
}