mock

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Net

type Net struct {
	mnet.Mocknet
}

Net creates a mock network for testing.

func NewMockNet

func NewMockNet() *Net

NewMockNet return a mock.Net instance

func (*Net) ConnectAllButSelf

func (mn *Net) ConnectAllButSelf(h host.Host) error

ConnectAllButSelf makes h connects to every node in net

func (*Net) GenPeerWithMarshalablePrivKey

func (mn *Net) GenPeerWithMarshalablePrivKey() (host.Host, error)

GenPeerWithMarshalablePrivKey is the alternative GenPeer(), to avoid the unmarshal failure when checking the sign

func (*Net) LinkAllButSelf

func (mn *Net) LinkAllButSelf(h host.Host) error

LinkAllButSelf makes h links to every node in net

func (*Net) MustConnect added in v0.0.9

func (mn *Net) MustConnect(a, b peer.ID)

MustConnect connects peer.

func (*Net) MustNewConnectedPeer added in v0.0.9

func (mn *Net) MustNewConnectedPeer() host.Host

MustNewConnectedPeer returns a full-mesh-connected host

func (*Net) MustNewLinkedPeer added in v0.0.9

func (mn *Net) MustNewLinkedPeer() host.Host

MustNewLinkedPeer returns a full-mesh-linked host

func (*Net) NewConnectedPeer

func (mn *Net) NewConnectedPeer() (host.Host, error)

NewConnectedPeer returns a full-mesh-connected host

func (*Net) NewLinkedPeer

func (mn *Net) NewLinkedPeer() (host.Host, error)

NewLinkedPeer returns a full-mesh-linked host

Jump to

Keyboard shortcuts

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