testing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: MIT Imports: 14 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DivulgeAddresses

func DivulgeAddresses(a, b network.Network)

DivulgeAddresses adds swarm a's addresses to swarm b's peerstore.

func GenSwarm

func GenSwarm(t *testing.T, ctx context.Context, opts ...Option) *swarm.Swarm

GenSwarm generates a new test swarm.

func GenUpgrader

func GenUpgrader(n *swarm.Swarm) *tptu.Upgrader

GenUpgrader creates a new connection upgrader for use with this swarm.

Types

type Option

type Option func(*testing.T, *config)

Option is an option that can be passed when constructing a test swarm.

var OptDialOnly Option = func(_ *testing.T, c *config) {
	c.dialOnly = true
}

OptDialOnly prevents the test swarm from listening.

var OptDisableReuseport Option = func(_ *testing.T, c *config) {
	c.disableReuseport = true
}

OptDisableReuseport disables reuseport in this test swarm.

Jump to

Keyboard shortcuts

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