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
|
@ -6,7 +6,7 @@ import (
|
|||
"testing"
|
||||
|
||||
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"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/exp/rand"
|
||||
|
@ -48,7 +48,7 @@ func (g RandAddrGenerator) Next() oid.Address {
|
|||
|
||||
// ObjectGenerator is the interface of types that generate object entries.
|
||||
type ObjectGenerator interface {
|
||||
Next() *object.Object
|
||||
Next() *objectSDK.Object
|
||||
}
|
||||
|
||||
// SeqObjGenerator is an ObjectGenerator that generates entries with random payloads of size objSize and sequential IDs.
|
||||
|
@ -59,7 +59,7 @@ type SeqObjGenerator struct {
|
|||
|
||||
var _ ObjectGenerator = &SeqObjGenerator{}
|
||||
|
||||
func generateObjectWithOIDWithCIDWithSize(oid oid.ID, cid cid.ID, sz uint64) *object.Object {
|
||||
func generateObjectWithOIDWithCIDWithSize(oid oid.ID, cid cid.ID, sz uint64) *objectSDK.Object {
|
||||
data := make([]byte, sz)
|
||||
_, _ = rand.Read(data)
|
||||
obj := GenerateObjectWithCIDWithPayload(cid, data)
|
||||
|
@ -67,7 +67,7 @@ func generateObjectWithOIDWithCIDWithSize(oid oid.ID, cid cid.ID, sz uint64) *ob
|
|||
return obj
|
||||
}
|
||||
|
||||
func (g *SeqObjGenerator) Next() *object.Object {
|
||||
func (g *SeqObjGenerator) Next() *objectSDK.Object {
|
||||
var id oid.ID
|
||||
binary.LittleEndian.PutUint64(id[:], g.cnt.Add(1))
|
||||
return generateObjectWithOIDWithCIDWithSize(id, cid.ID{}, g.ObjSize)
|
||||
|
@ -80,7 +80,7 @@ type RandObjGenerator struct {
|
|||
|
||||
var _ ObjectGenerator = &RandObjGenerator{}
|
||||
|
||||
func (g *RandObjGenerator) Next() *object.Object {
|
||||
func (g *RandObjGenerator) Next() *objectSDK.Object {
|
||||
var id oid.ID
|
||||
_, _ = rand.Read(id[:])
|
||||
return generateObjectWithOIDWithCIDWithSize(id, cid.ID{}, g.ObjSize)
|
||||
|
@ -92,13 +92,13 @@ type OverwriteObjGenerator struct {
|
|||
MaxObjects uint64
|
||||
}
|
||||
|
||||
func (g *OverwriteObjGenerator) Next() *object.Object {
|
||||
func (g *OverwriteObjGenerator) Next() *objectSDK.Object {
|
||||
var id oid.ID
|
||||
binary.LittleEndian.PutUint64(id[:], uint64(1+rand.Int63n(int64(g.MaxObjects))))
|
||||
return generateObjectWithOIDWithCIDWithSize(id, cid.ID{}, g.ObjSize)
|
||||
}
|
||||
|
||||
func AddressFromObject(t testing.TB, obj *object.Object) oid.Address {
|
||||
func AddressFromObject(t testing.TB, obj *objectSDK.Object) oid.Address {
|
||||
var addr oid.Address
|
||||
|
||||
id, isSet := obj.ID()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue