Versions in this module Expand all Collapse all v0 v0.0.2 Jan 24, 2020 v0.0.1 Jan 24, 2020 Changes in this version + const MessageSizeMax + var DialPeerTimeout = 60 * time.Second + var ErrNoConn = errors.New("no usable connection to peer") + var ErrNoRemoteAddrs = errors.New("no remote addresses") + var GlobalNoopNotifiee = &NoopNotifiee + func GetDialPeerTimeout(ctx context.Context) time.Duration + func GetNoDial(ctx context.Context) (nodial bool, reason string) + func WithDialPeerTimeout(ctx context.Context, timeout time.Duration) context.Context + func WithNoDial(ctx context.Context, reason string) context.Context + type Conn interface + GetStreams func() []Stream + NewStream func() (Stream, error) + Stat func() Stat + type ConnHandler func(Conn) + type ConnMultiaddrs interface + LocalMultiaddr func() ma.Multiaddr + RemoteMultiaddr func() ma.Multiaddr + type ConnSecurity interface + LocalPeer func() peer.ID + LocalPrivateKey func() ic.PrivKey + RemotePeer func() peer.ID + RemotePublicKey func() ic.PubKey + type Connectedness int + const CanConnect + const CannotConnect + const Connected + const NotConnected + type Dialer interface + ClosePeer func(peer.ID) error + Connectedness func(peer.ID) Connectedness + Conns func() []Conn + ConnsToPeer func(p peer.ID) []Conn + DialPeer func(context.Context, peer.ID) (Conn, error) + LocalPeer func() peer.ID + Notify func(Notifiee) + Peers func() []peer.ID + Peerstore func() peerstore.Peerstore + StopNotify func(Notifiee) + type Direction int + const DirInbound + const DirOutbound + const DirUnknown + type Network interface + Context func() context.Context + InterfaceListenAddresses func() ([]ma.Multiaddr, error) + Listen func(...ma.Multiaddr) error + ListenAddresses func() []ma.Multiaddr + NewStream func(context.Context, peer.ID) (Stream, error) + SetConnHandler func(ConnHandler) + SetStreamHandler func(StreamHandler) + type NoopNotifiee struct + func (nn *NoopNotifiee) ClosedStream(Network, Stream) + func (nn *NoopNotifiee) Connected(n Network, c Conn) + func (nn *NoopNotifiee) Disconnected(n Network, c Conn) + func (nn *NoopNotifiee) Listen(n Network, addr ma.Multiaddr) + func (nn *NoopNotifiee) ListenClose(n Network, addr ma.Multiaddr) + func (nn *NoopNotifiee) OpenedStream(Network, Stream) + type Notifiee interface + ClosedStream func(Network, Stream) + Connected func(Network, Conn) + Disconnected func(Network, Conn) + Listen func(Network, ma.Multiaddr) + ListenClose func(Network, ma.Multiaddr) + OpenedStream func(Network, Stream) + type NotifyBundle struct + ClosedStreamF func(Network, Stream) + ConnectedF func(Network, Conn) + DisconnectedF func(Network, Conn) + ListenCloseF func(Network, ma.Multiaddr) + ListenF func(Network, ma.Multiaddr) + OpenedStreamF func(Network, Stream) + func (nb *NotifyBundle) ClosedStream(n Network, s Stream) + func (nb *NotifyBundle) Connected(n Network, c Conn) + func (nb *NotifyBundle) Disconnected(n Network, c Conn) + func (nb *NotifyBundle) Listen(n Network, a ma.Multiaddr) + func (nb *NotifyBundle) ListenClose(n Network, a ma.Multiaddr) + func (nb *NotifyBundle) OpenedStream(n Network, s Stream) + type Stat struct + Direction Direction + Extra map[interface{}]interface{} + type Stream interface + Conn func() Conn + Protocol func() protocol.ID + SetProtocol func(id protocol.ID) + Stat func() Stat + type StreamHandler func(Stream)