Versions in this module Expand all Collapse all v0 v0.23.5 Nov 8, 2022 Changes in this version + const MessageSizeMax + const ReservationPriorityAlways + const ReservationPriorityHigh + const ReservationPriorityLow + const ReservationPriorityMedium + var DialPeerTimeout = 60 * time.Second + var ErrNoConn = errors.New("no usable connection to peer") + var ErrNoRemoteAddrs = errors.New("no remote addresses") + var ErrReset = errors.New("stream reset") + var ErrResourceLimitExceeded = temporaryError("resource limit exceeded") + var ErrResourceScopeClosed = errors.New("resource scope closed") + var ErrTransientConn = errors.New("transient connection to peer") + var GlobalNoopNotifiee = &NoopNotifiee + var NullScope = &nullScope + func GetDialPeerTimeout(ctx context.Context) time.Duration + func GetForceDirectDial(ctx context.Context) (forceDirect bool, reason string) + func GetNoDial(ctx context.Context) (nodial bool, reason string) + func GetSimultaneousConnect(ctx context.Context) (simconnect bool, isClient bool, reason string) + func GetUseTransient(ctx context.Context) (usetransient bool, reason string) + func WithDialPeerTimeout(ctx context.Context, timeout time.Duration) context.Context + func WithForceDirectDial(ctx context.Context, reason string) context.Context + func WithNoDial(ctx context.Context, reason string) context.Context + func WithSimultaneousConnect(ctx context.Context, isClient bool, reason string) context.Context + func WithUseTransient(ctx context.Context, reason string) context.Context + type Conn interface + GetStreams func() []Stream + ID func() string + NewStream func(context.Context) (Stream, error) + type ConnManagementScope interface + PeerScope func() PeerScope + SetPeer func(peer.ID) error + type ConnMultiaddrs interface + LocalMultiaddr func() ma.Multiaddr + RemoteMultiaddr func() ma.Multiaddr + type ConnScope interface + type ConnScoper interface + Scope func() ConnScope + type ConnSecurity interface + LocalPeer func() peer.ID + LocalPrivateKey func() ic.PrivKey + RemotePeer func() peer.ID + RemotePublicKey func() ic.PubKey + type ConnStat interface + Stat func() ConnStats + type ConnStats struct + NumStreams int + type Connectedness int + const CanConnect + const CannotConnect + const Connected + const NotConnected + func (c Connectedness) String() string + 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 + func (d Direction) String() string + type Multiplexer interface + NewConn func(c net.Conn, isServer bool, scope PeerScope) (MuxedConn, error) + type MuxedConn interface + AcceptStream func() (MuxedStream, error) + IsClosed func() bool + OpenStream func(context.Context) (MuxedStream, error) + type MuxedStream interface + CloseRead func() error + CloseWrite func() error + Reset func() error + SetDeadline func(time.Time) error + SetReadDeadline func(time.Time) error + SetWriteDeadline func(time.Time) error + type NATDeviceType int + const NATDeviceTypeCone + const NATDeviceTypeSymmetric + const NATDeviceTypeUnknown + func (r NATDeviceType) String() string + type NATTransportProtocol int + const NATTransportTCP + const NATTransportUDP + func (n NATTransportProtocol) String() string + type Network interface + InterfaceListenAddresses func() ([]ma.Multiaddr, error) + Listen func(...ma.Multiaddr) error + ListenAddresses func() []ma.Multiaddr + NewStream func(context.Context, peer.ID) (Stream, error) + ResourceManager func() ResourceManager + SetStreamHandler func(StreamHandler) + type NoopNotifiee struct + 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) + type Notifiee interface + Connected func(Network, Conn) + Disconnected func(Network, Conn) + Listen func(Network, ma.Multiaddr) + ListenClose func(Network, ma.Multiaddr) + type NotifyBundle struct + ConnectedF func(Network, Conn) + DisconnectedF func(Network, Conn) + ListenCloseF func(Network, ma.Multiaddr) + ListenF func(Network, ma.Multiaddr) + 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) + type PeerScope interface + Peer func() peer.ID + type ProtocolScope interface + Protocol func() protocol.ID + type Reachability int + const ReachabilityPrivate + const ReachabilityPublic + const ReachabilityUnknown + func (r Reachability) String() string + type ResourceManager interface + Close func() error + OpenConnection func(dir Direction, usefd bool, endpoint multiaddr.Multiaddr) (ConnManagementScope, error) + OpenStream func(p peer.ID, dir Direction) (StreamManagementScope, error) + var NullResourceManager ResourceManager = &nullResourceManager{} + type ResourceScope interface + BeginSpan func() (ResourceScopeSpan, error) + ReleaseMemory func(size int) + ReserveMemory func(size int, prio uint8) error + Stat func() ScopeStat + type ResourceScopeSpan interface + Done func() + type ResourceScopeViewer interface + ViewPeer func(peer.ID, func(PeerScope) error) error + ViewProtocol func(protocol.ID, func(ProtocolScope) error) error + ViewService func(string, func(ServiceScope) error) error + ViewSystem func(func(ResourceScope) error) error + ViewTransient func(func(ResourceScope) error) error + type ScopeStat struct + Memory int64 + NumConnsInbound int + NumConnsOutbound int + NumFD int + NumStreamsInbound int + NumStreamsOutbound int + type ServiceScope interface + Name func() string + type Stats struct + Direction Direction + Extra map[interface{}]interface{} + Opened time.Time + Transient bool + type Stream interface + Conn func() Conn + ID func() string + Protocol func() protocol.ID + Scope func() StreamScope + SetProtocol func(id protocol.ID) error + Stat func() Stats + type StreamHandler func(Stream) + type StreamManagementScope interface + PeerScope func() PeerScope + ProtocolScope func() ProtocolScope + ServiceScope func() ServiceScope + SetProtocol func(proto protocol.ID) error + SetService func(srv string) error + type StreamScope interface + SetService func(srv string) error