testutil

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 8 Imported by: 0

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 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 GenerateOptimizedPeers

func GenerateOptimizedPeers(n int, optCount int, curveFunc func(float64) float64) []bssd.OptimizedPeer

GenerateOptimizedPeers creates n peer ids, with optimization fall off up to optCount, curveFunc to scale it

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 GenerateWantlist

func GenerateWantlist(n int, ses uint64) *wantlist.SessionTrackedWantlist

GenerateWantlist makes a populated wantlist.

func IndexOf

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

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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