Versions in this module Expand all Collapse all v0 v0.0.1 Mar 31, 2021 Changes in this version + var ErrClosed error = errors.New("stream closed") + func ConnComplement(c network.Conn) network.Conn + func StreamComplement(s network.Stream) network.Stream + type Link interface + Networks func() []network.Network + Options func() LinkOptions + Peers func() []peer.ID + SetOptions func(LinkOptions) + type LinkMap map[string]map[string]map[Link]struct + type LinkOptions struct + Bandwidth float64 + Latency time.Duration + type Mocknet interface + AddPeer func(ic.PrivKey, ma.Multiaddr) (host.Host, error) + AddPeerWithPeerstore func(peer.ID, peerstore.Peerstore) (host.Host, error) + ConnectAllButSelf func() error + ConnectNets func(network.Network, network.Network) (network.Conn, error) + ConnectPeers func(peer.ID, peer.ID) (network.Conn, error) + DisconnectNets func(network.Network, network.Network) error + DisconnectPeers func(peer.ID, peer.ID) error + GenPeer func() (host.Host, error) + Host func(peer.ID) host.Host + Hosts func() []host.Host + LinkAll func() error + LinkDefaults func() LinkOptions + LinkNets func(network.Network, network.Network) (Link, error) + LinkPeers func(peer.ID, peer.ID) (Link, error) + Links func() LinkMap + LinksBetweenNets func(a, b network.Network) []Link + LinksBetweenPeers func(a, b peer.ID) []Link + Net func(peer.ID) network.Network + Nets func() []network.Network + Peers func() []peer.ID + SetLinkDefaults func(LinkOptions) + Unlink func(Link) error + UnlinkNets func(network.Network, network.Network) error + UnlinkPeers func(peer.ID, peer.ID) error + func FullMeshConnected(ctx context.Context, n int) (Mocknet, error) + func FullMeshLinked(ctx context.Context, n int) (Mocknet, error) + func New(ctx context.Context) Mocknet + func WithNPeers(ctx context.Context, n int) (Mocknet, error) + type Printer interface + MocknetLinks func(mn Mocknet) + NetworkConns func(ni network.Network) + func PrinterTo(w io.Writer) Printer + type RateLimiter struct + func NewRateLimiter(bandwidth float64) *RateLimiter + func (r *RateLimiter) Limit(dataSize int) time.Duration + func (r *RateLimiter) UpdateBandwidth(bandwidth float64)