testing

package
v0.0.0-...-8b9b725 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DivulgeAddresses

func DivulgeAddresses(a, b inet.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