Versions in this module Expand all Collapse all v0 v0.0.2-rc1 Jan 27, 2020 v0.0.1 Jan 24, 2020 Changes in this version + const ConcurrentFdDials + const DefaultPerPeerRateLimit + const DialAttempts + var BackoffBase = time.Second * 5 + var BackoffCoef = time.Second + var BackoffMax = time.Minute * 5 + var DialTimeoutLocal = 5 * time.Second + var ErrAddrFiltered = errors.New("address filtered") + var ErrAllDialsFailed = errors.New("all dials failed") + var ErrConnClosed = errors.New("connection closed") + var ErrDialBackoff = errors.New("dial backoff") + var ErrDialTimeout = errors.New("dial timed out") + var ErrDialToSelf = errors.New("dial to self attempted") + var ErrNoAddresses = errors.New("no addresses") + var ErrNoGoodAddresses = errors.New("no good addresses") + var ErrNoTransport = errors.New("no transport for protocol") + var ErrSwarmClosed = errors.New("swarm closed") + type Conn struct + func (c *Conn) Close() error + func (c *Conn) GetStreams() []network.Stream + func (c *Conn) LocalMultiaddr() ma.Multiaddr + func (c *Conn) LocalPeer() peer.ID + func (c *Conn) LocalPrivateKey() ic.PrivKey + func (c *Conn) NewStream() (network.Stream, error) + func (c *Conn) RemoteMultiaddr() ma.Multiaddr + func (c *Conn) RemotePeer() peer.ID + func (c *Conn) RemotePublicKey() ic.PubKey + func (c *Conn) Stat() network.Stat + func (c *Conn) String() string + type DialBackoff struct + func (db *DialBackoff) AddBackoff(p peer.ID) + func (db *DialBackoff) Backoff(p peer.ID) (backoff bool) + func (db *DialBackoff) Clear(p peer.ID) + type DialError struct + Cause error + DialErrors []TransportError + Peer peer.ID + Skipped int + func (e *DialError) Error() string + func (e *DialError) Timeout() bool + func (e *DialError) Unwrap() error + type DialFunc func(context.Context, peer.ID) (*Conn, error) + type DialSync struct + func NewDialSync(dfn DialFunc) *DialSync + func (ds *DialSync) CancelDial(p peer.ID) + func (ds *DialSync) DialLock(ctx context.Context, p peer.ID) (*Conn, error) + type Stream struct + func (s *Stream) Close() error + func (s *Stream) Conn() network.Conn + func (s *Stream) Protocol() protocol.ID + func (s *Stream) Read(p []byte) (int, error) + func (s *Stream) Reset() error + func (s *Stream) SetDeadline(t time.Time) error + func (s *Stream) SetProtocol(p protocol.ID) + func (s *Stream) SetReadDeadline(t time.Time) error + func (s *Stream) SetWriteDeadline(t time.Time) error + func (s *Stream) Stat() network.Stat + func (s *Stream) String() string + func (s *Stream) Write(p []byte) (int, error) + type Swarm struct + Filters *filter.Filters + func NewSwarm(ctx context.Context, logger *zap.Logger, local peer.ID, ...) *Swarm + func (s *Swarm) AddAddrFilter(f string) error + func (s *Swarm) AddListenAddr(a ma.Multiaddr) error + func (s *Swarm) AddTransport(t transport.Transport) error + func (s *Swarm) Backoff() *DialBackoff + func (s *Swarm) Close() error + func (s *Swarm) ClosePeer(p peer.ID) error + func (s *Swarm) ConnHandler() network.ConnHandler + func (s *Swarm) Connectedness(p peer.ID) network.Connectedness + func (s *Swarm) Conns() []network.Conn + func (s *Swarm) ConnsToPeer(p peer.ID) []network.Conn + func (s *Swarm) Context() context.Context + func (s *Swarm) DialPeer(ctx context.Context, p peer.ID) (network.Conn, error) + func (s *Swarm) InterfaceListenAddresses() ([]ma.Multiaddr, error) + func (s *Swarm) Listen(addrs ...ma.Multiaddr) error + func (s *Swarm) ListenAddresses() []ma.Multiaddr + func (s *Swarm) LocalPeer() peer.ID + func (s *Swarm) NewStream(ctx context.Context, p peer.ID) (network.Stream, error) + func (s *Swarm) Notify(f network.Notifiee) + func (s *Swarm) Peers() []peer.ID + func (s *Swarm) Peerstore() peerstore.Peerstore + func (s *Swarm) SetConnHandler(handler network.ConnHandler) + func (s *Swarm) SetStreamHandler(handler network.StreamHandler) + func (s *Swarm) StopNotify(f network.Notifiee) + func (s *Swarm) StreamHandler() network.StreamHandler + func (s *Swarm) String() string + func (s *Swarm) TransportForDialing(a ma.Multiaddr) transport.Transport + func (s *Swarm) TransportForListening(a ma.Multiaddr) transport.Transport + type TransportError struct + Address ma.Multiaddr + Cause error + func (e *TransportError) Error() string