mock

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNode

func NewNode(keyId *common.PeerKeyId, listenAddr string, localInfo *peer.PeerInfo, proto p2p.Protocol, nw Network,
	reservedPeers []string, reserveAddrFilter p2p.AddressFilter, logger common.Logger) *netserver.NetServer

Types

type Listener

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

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

func (*Listener) Close

func (l *Listener) Close() error

func (*Listener) ID

func (l *Listener) ID() string

func (*Listener) Network

func (l *Listener) Network() string

func (*Listener) PushToAccept

func (l *Listener) PushToAccept(conn net.Conn)

func (*Listener) String

func (l *Listener) String() string

type Network

type Network interface {
	// NewListener will gen random ip to listen
	NewListener(id common.PeerId) (string, net.Listener)
	// addr: ip:port
	NewListenerWithAddr(id common.PeerId, addr string) net.Listener

	// NewDialer will gen random source IP
	NewDialer(id common.PeerId) connect_controller.Dialer
	NewDialerWithHost(id common.PeerId, host string) connect_controller.Dialer
	AllowConnect(id1, id2 common.PeerId)
	DeliverRate(percent uint)
}

func NewNetwork

func NewNetwork() Network

Jump to

Keyboard shortcuts

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