testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0, MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCids

func GenerateCids(n int) []cid.Cid

GenerateCids produces n content identifiers.

func GetBstoreLen

func GetBstoreLen(ctx context.Context, t *testing.T, bs RoBlockstore) int

GetBstoreLen gets the total CID cound in a blockstore

func OpenSampleCar

func OpenSampleCar(t *testing.T, carFileName string) *blockstore.ReadOnly

OpenSampleCar opens a car file in the testdata directory to a blockstore

func RandomCids added in v0.2.0

func RandomCids(n int) ([]cid.Cid, error)

func RandomMultihashes added in v0.2.0

func RandomMultihashes(n int) ([]multihash.Multihash, error)

func SetupDataTransferOnHost

func SetupDataTransferOnHost(t *testing.T, h host.Host, store datastore.Batching, lsys ipld.LinkSystem) datatransfer.Manager

SetupDataTransferOnHost generates a data transfer instance for the given libp2p host

func ThisDir

func ThisDir(t *testing.T) string

ThisDir gets the current directory of the source file its called in

Types

type RoBlockstore

type RoBlockstore interface {
	AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
}

RoBlockstore is just the needed interface for GetBstoreLen

Jump to

Keyboard shortcuts

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