Help us shape the future of Go! Take the 2026 Go Developer Survey

simlibp2p

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const OneMbps = 1_000_000

Variables

This section is empty.

Functions

func GetBasicHostPair added in v0.47.0

func GetBasicHostPair(t *testing.T) (host.Host, host.Host)

GetBasicHostPair gets a new pair of hosts. The first host initiates the connection to the second host.

func MustNewHost

func MustNewHost(t *testing.T, opts ...libp2p.Option) host.Host

func QUICSimnet

func QUICSimnet(simnet *simnet.Simnet, linkSettings simnet.NodeBiDiLinkSettings, quicReuseOpts ...quicreuse.Option) libp2p.Option

Types

type BlankHostOpts

type BlankHostOpts struct {
	ConnMgr *connmgr.BasicConnMgr
	// contains filtered or unexported fields
}

type HostAndIdx

type HostAndIdx struct {
	Host host.Host
	Idx  int
}

type LatencyFunc added in v0.47.0

type LatencyFunc func(*simnet.Packet) time.Duration

type MockSourceIPSelector

type MockSourceIPSelector struct {
	// contains filtered or unexported fields
}

func (*MockSourceIPSelector) PreferredSourceIPForDestination

func (m *MockSourceIPSelector) PreferredSourceIPForDestination(_ *net.UDPAddr) (net.IP, error)

type NetworkSettings

type NetworkSettings struct {
	UseBlankHost            bool
	QUICReuseOptsForHostIdx func(idx int) []quicreuse.Option
	BlankHostOptsForHostIdx func(idx int) BlankHostOpts
}

type NodeLinkSettingsAndCount

type NodeLinkSettingsAndCount struct {
	LinkSettings simnet.NodeBiDiLinkSettings
	Count        int
}

type SimpleLibp2pNetworkMeta

type SimpleLibp2pNetworkMeta struct {
	Nodes      []host.Host
	AddrToNode map[string]HostAndIdx
}

func SimpleLibp2pNetwork

func SimpleLibp2pNetwork(linkSettings []NodeLinkSettingsAndCount, latencyFunc LatencyFunc, networkSettings NetworkSettings) (*simnet.Simnet, *SimpleLibp2pNetworkMeta, error)

Jump to

Keyboard shortcuts

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