testutil

package
v0.8.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0, MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsBlock

func ContainsBlock(blks []blocks.Block, block blocks.Block) bool

ContainsBlock returns true if a block is found n a list of blocks

func ContainsKey

func ContainsKey(ks []cid.Cid, c cid.Cid) bool

ContainsKey returns true if a key is found n a list of CIDs.

func ContainsPeer

func ContainsPeer(peers []peer.ID, p peer.ID) bool

ContainsPeer returns true if a peer is found n a list of peers.

func GenerateBlocksOfSize

func GenerateBlocksOfSize(n int, size int64) []blocks.Block

GenerateBlocksOfSize generates a series of blocks of the given byte size

func GenerateCids

func GenerateCids(n int) []cid.Cid

GenerateCids produces n content identifiers.

func GenerateMessageEntries

func GenerateMessageEntries(n int, isCancel bool) []bsmsg.Entry

GenerateMessageEntries makes fake bitswap message entries.

func GeneratePeers

func GeneratePeers(n int) []peer.ID

GeneratePeers creates n peer ids.

func GenerateSessionID

func GenerateSessionID() uint64

GenerateSessionID make a unit session identifier.

func IndexOf

func IndexOf(blks []blocks.Block, c cid.Cid) int

IndexOf returns the index of a given cid in an array of blocks

func MatchKeysIgnoreOrder

func MatchKeysIgnoreOrder(ks1 []cid.Cid, ks2 []cid.Cid) bool

MatchKeysIgnoreOrder returns true if the lists of CIDs match (even if they're in a different order)

func MatchPeersIgnoreOrder

func MatchPeersIgnoreOrder(ps1 []peer.ID, ps2 []peer.ID) bool

MatchPeersIgnoreOrder returns true if the lists of peers match (even if they're in a different order)

Types

This section is empty.

Jump to

Keyboard shortcuts

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