testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0, MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNoDupes

func GenerateNoDupes(gen func() unixfs.DirEntry) unixfs.DirEntry

GenerateNoDupes runs the unixfsnode/testutil generator function repeatedly until it produces a DAG with strictly no duplicate CIDs.

func GenerateStrictlyNestedShardedDir

func GenerateStrictlyNestedShardedDir(t *testing.T, linkSys *linking.LinkSystem, randReader io.Reader, targetSize int) unixfs.DirEntry

GenerateStrictlyNestedShardedDir is a wrapper around unixfsnode/testutil.GenerateDirectory that uses dark magic to repeatedly generate a sharded directory until it produces one that is strictly nested. That is, it produces a sharded directory structure with strictly at least one level of sharding with at least two child shards.

Since it is possible to produce a sharded directory that is contained in a single block, this function provides a way to generate a sharded directory for cases where we need to test multi-level sharding.

func ToBlocks

func ToBlocks(t *testing.T, lsys linking.LinkSystem, root cid.Cid, selNode datamodel.Node) []blocks.Block

ToBlocks makes a block array from ordered blocks in a traversal

Types

type CorrectedMemStore

type CorrectedMemStore struct {
	ParentStore
}

TODO: remove when this is fixed in IPLD prime

func (*CorrectedMemStore) Get

func (cms *CorrectedMemStore) Get(ctx context.Context, key string) ([]byte, error)

func (*CorrectedMemStore) GetStream

func (cms *CorrectedMemStore) GetStream(ctx context.Context, key string) (io.ReadCloser, error)

type ZeroReader

type ZeroReader struct{}

func (ZeroReader) Read

func (ZeroReader) Read(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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