Documentation ¶
Index ¶
- func DivulgeAddresses(a, b network.Network)
- func GenSwarm(t *testing.T, ctx context.Context, opts ...Option) *swarm.Swarm
- func GenUpgrader(n *swarm.Swarm) *tptu.Upgrader
- type MockConnectionGater
- func (m *MockConnectionGater) InterceptAccept(c network.ConnMultiaddrs) (allow bool)
- func (m *MockConnectionGater) InterceptAddrDial(p peer.ID, addr ma.Multiaddr) (allow bool)
- func (m *MockConnectionGater) InterceptPeerDial(p peer.ID) (allow bool)
- func (m *MockConnectionGater) InterceptSecured(d network.Direction, p peer.ID, c network.ConnMultiaddrs) (allow bool)
- func (m *MockConnectionGater) InterceptUpgraded(tc network.Conn) (allow bool, reason control.DisconnectReason)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DivulgeAddresses ¶
DivulgeAddresses adds swarm a's addresses to swarm b's peerstore.
Types ¶
type MockConnectionGater ¶ added in v0.2.4
type MockConnectionGater struct { Dial func(p peer.ID, addr ma.Multiaddr) bool PeerDial func(p peer.ID) bool Accept func(c network.ConnMultiaddrs) bool Secured func(network.Direction, peer.ID, network.ConnMultiaddrs) bool Upgraded func(c network.Conn) (bool, control.DisconnectReason) }
MockConnectionGater is a mock connection gater to be used by the tests.
func DefaultMockConnectionGater ¶ added in v0.2.4
func DefaultMockConnectionGater() *MockConnectionGater
func (*MockConnectionGater) InterceptAccept ¶ added in v0.2.4
func (m *MockConnectionGater) InterceptAccept(c network.ConnMultiaddrs) (allow bool)
func (*MockConnectionGater) InterceptAddrDial ¶ added in v0.2.4
func (*MockConnectionGater) InterceptPeerDial ¶ added in v0.2.4
func (m *MockConnectionGater) InterceptPeerDial(p peer.ID) (allow bool)
func (*MockConnectionGater) InterceptSecured ¶ added in v0.2.4
func (m *MockConnectionGater) InterceptSecured(d network.Direction, p peer.ID, c network.ConnMultiaddrs) (allow bool)
func (*MockConnectionGater) InterceptUpgraded ¶ added in v0.2.4
func (m *MockConnectionGater) InterceptUpgraded(tc network.Conn) (allow bool, reason control.DisconnectReason)
type Option ¶
Option is an option that can be passed when constructing a test swarm.
OptDialOnly prevents the test swarm from listening.
OptDisableReuseport disables reuseport in this test swarm.
func OptConnGater ¶ added in v0.2.4
func OptConnGater(cg connmgr.ConnectionGater) Option
OptConnGater configures the given connection gater on the test
func OptPeerPrivateKey ¶ added in v0.2.6
OptPeerPrivateKey configures the peer private key which is then used to derive the public key and peer ID.
Click to show internal directories.
Click to hide internal directories.