testutil

package
v0.42.0-rc.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAttribute

func AddAttribute(obj *objectSDK.Object, key, val string)

func AddPayload

func AddPayload(obj *objectSDK.Object, size int)

func AddressFromObject

func AddressFromObject(t testing.TB, obj *objectSDK.Object) oid.Address

func GenerateObject

func GenerateObject() *objectSDK.Object

func GenerateObjectWithCID

func GenerateObjectWithCID(cnr cid.ID) *objectSDK.Object

func GenerateObjectWithCIDWithPayload

func GenerateObjectWithCIDWithPayload(cnr cid.ID, data []byte) *objectSDK.Object

func GenerateObjectWithSize added in v0.37.0

func GenerateObjectWithSize(sz int) *objectSDK.Object

Types

type AddressGenerator

type AddressGenerator interface {
	Next() oid.Address
}

AddressGenerator is the interface of types that generate object addresses.

type ObjectGenerator

type ObjectGenerator interface {
	Next() *objectSDK.Object
}

ObjectGenerator is the interface of types that generate object entries.

type OverwriteObjGenerator

type OverwriteObjGenerator struct {
	ObjSize    uint64
	MaxObjects uint64
}

OverwriteObjGenerator is an ObjectGenerator that generates entries with random payloads of size objSize and at most maxObjects distinct IDs.

func (*OverwriteObjGenerator) Next

type RandAddrGenerator

type RandAddrGenerator uint64

RandAddrGenerator is an addressGenerator that generates random addresses in the given range.

func (RandAddrGenerator) Next

func (g RandAddrGenerator) Next() oid.Address

type RandObjGenerator

type RandObjGenerator struct {
	ObjSize uint64
}

RandObjGenerator is an ObjectGenerator that generates entries with random IDs and payloads of size objSize.

func (*RandObjGenerator) Next

func (g *RandObjGenerator) Next() *objectSDK.Object

type SeqAddrGenerator

type SeqAddrGenerator struct {
	MaxID uint64
	// contains filtered or unexported fields
}

SeqAddrGenerator is an AddressGenerator that generates addresses sequentially and wraps around the given max ID.

func (*SeqAddrGenerator) Next

func (g *SeqAddrGenerator) Next() oid.Address

type SeqObjGenerator

type SeqObjGenerator struct {
	ObjSize uint64
	// contains filtered or unexported fields
}

SeqObjGenerator is an ObjectGenerator that generates entries with random payloads of size objSize and sequential IDs.

func (*SeqObjGenerator) Next

func (g *SeqObjGenerator) Next() *objectSDK.Object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL