testutil

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(t *testing.T, src string, dst string)

CopyDir copies a whole directory recursively

func CopyFile

func CopyFile(t *testing.T, src, dst string)

CopyFile copies a single file from src to dst

func GetBstoreLen

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

GetBstoreLen gets the total CID cound in a blockstore

func MultiAddsToString

func MultiAddsToString(addrs []multiaddr.Multiaddr) []string

func OpenSampleCar

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

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

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 StringsToMultiaddrs added in v0.12.0

func StringsToMultiaddrs(t *testing.T, addrs []string) []multiaddr.Multiaddr

func ThisDir

func ThisDir(t *testing.T) string

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

func WaitForAddrs

func WaitForAddrs(h host.Host) peer.AddrInfo

Sometimes the peerstore is not populated immediately. This is resolved by a delay and retry.

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