testing

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 9 Imported by: 13

Documentation

Overview

Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/p2p/net/swarm/testing.

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. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.DivulgeAddresses instead.

func GenSwarm

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

GenSwarm generates a new test swarm. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.GenSwarm instead.

func GenUpgrader

func GenUpgrader(t *testing.T, n *swarm.Swarm, opts ...tptu.Option) transport.Upgrader

GenUpgrader creates a new connection upgrader for use with this swarm. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.GenUpgrader instead.

Types

type MockConnectionGater added in v0.2.4

type MockConnectionGater = swarm_testing.MockConnectionGater

MockConnectionGater is a mock connection gater to be used by the tests. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.MockConnectionGater instead.

type Option

type Option = swarm_testing.Option

Option is an option that can be passed when constructing a test swarm. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.Option instead.

var OptDialOnly Option = swarm_testing.OptDialOnly

OptDialOnly prevents the test swarm from listening. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.OptDialOnly instead.

var OptDisableQUIC Option = swarm_testing.OptDisableQUIC

OptDisableQUIC disables QUIC. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.OptDisableQUIC instead.

var OptDisableReuseport Option = swarm_testing.OptDisableReuseport

OptDisableReuseport disables reuseport in this test swarm. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.OptDisableReuseport instead.

var OptDisableTCP Option = swarm_testing.OptDisableTCP

OptDisableTCP disables TCP. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.OptDisableTCP instead.

func DialTimeout deprecated added in v0.10.0

func DialTimeout(t time.Duration) Option

Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.DialTimeout instead.

func OptConnGater added in v0.2.4

func OptConnGater(cg connmgr.ConnectionGater) Option

OptConnGater configures the given connection gater on the test Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.OptConnGater instead.

func OptPeerPrivateKey added in v0.2.6

func OptPeerPrivateKey(sk crypto.PrivKey) Option

OptPeerPrivateKey configures the peer private key which is then used to derive the public key and peer ID. Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.OptPeerPrivateKey instead.

func OptResourceManager deprecated added in v0.10.0

func OptResourceManager(rcmgr network.ResourceManager) Option

Deprecated: use github.com/libp2p/go-libp2p/p2p/net/swarm/testing.OptResourceManager instead.

Jump to

Keyboard shortcuts

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