forked from TrueCloudLab/frostfs-node
[#496] node: Fix linter importas
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:
parent
4bbe9cc936
commit
033eaf77e1
80 changed files with 444 additions and 443 deletions
|
@ -10,7 +10,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/writecache"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-observability/tracing"
|
||||
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
|
||||
"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"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
@ -29,7 +29,7 @@ type RngPrm struct {
|
|||
|
||||
// RngRes groups the resulting values of GetRange operation.
|
||||
type RngRes struct {
|
||||
obj *object.Object
|
||||
obj *objectSDK.Object
|
||||
hasMeta bool
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ func (p *RngPrm) SetIgnoreMeta(ignore bool) {
|
|||
// Object returns the requested object part.
|
||||
//
|
||||
// Instance payload contains the requested range of the original object.
|
||||
func (r RngRes) Object() *object.Object {
|
||||
func (r RngRes) Object() *objectSDK.Object {
|
||||
return r.obj
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ func (r RngRes) HasMeta() bool {
|
|||
// Returns ErrRangeOutOfBounds if the requested object range is out of bounds.
|
||||
// Returns an error of type apistatus.ObjectNotFound if the requested object is missing.
|
||||
// Returns an error of type apistatus.ObjectAlreadyRemoved if the requested object has been marked as removed in shard.
|
||||
// Returns the object.ErrObjectIsExpired if the object is presented but already expired.
|
||||
// Returns the objectSDK.ErrObjectIsExpired if the object is presented but already expired.
|
||||
// Returns the ErrShardDisabled if the shard is disabled.
|
||||
func (s *Shard) GetRange(ctx context.Context, prm RngPrm) (RngRes, error) {
|
||||
ctx, span := tracing.StartSpanFromContext(ctx, "Shard.GetRange",
|
||||
|
@ -91,7 +91,7 @@ func (s *Shard) GetRange(ctx context.Context, prm RngPrm) (RngRes, error) {
|
|||
return RngRes{}, ErrShardDisabled
|
||||
}
|
||||
|
||||
cb := func(stor *blobstor.BlobStor, id []byte) (*object.Object, error) {
|
||||
cb := func(stor *blobstor.BlobStor, id []byte) (*objectSDK.Object, error) {
|
||||
var getRngPrm common.GetRangePrm
|
||||
getRngPrm.Address = prm.addr
|
||||
getRngPrm.Range.SetOffset(prm.off)
|
||||
|
@ -103,13 +103,13 @@ func (s *Shard) GetRange(ctx context.Context, prm RngPrm) (RngRes, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
obj := object.New()
|
||||
obj := objectSDK.New()
|
||||
obj.SetPayload(res.Data)
|
||||
|
||||
return obj, nil
|
||||
}
|
||||
|
||||
wc := func(c writecache.Cache) (*object.Object, error) {
|
||||
wc := func(c writecache.Cache) (*objectSDK.Object, error) {
|
||||
res, err := c.Get(ctx, prm.addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -122,7 +122,7 @@ func (s *Shard) GetRange(ctx context.Context, prm RngPrm) (RngRes, error) {
|
|||
return nil, logicerr.Wrap(apistatus.ObjectOutOfRange{})
|
||||
}
|
||||
|
||||
obj := object.New()
|
||||
obj := objectSDK.New()
|
||||
obj.SetPayload(payload[from:to])
|
||||
return obj, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue