package
0.41.0
Repository: https://github.com/libp2p/go-libp2p.git
Documentation: pkg.go.dev

# Packages

Package mocknetwork is a generated GoMock package.

# Functions

GetAllowLimitedConn returns true if the allow limited conn option is set in the context.
GetDialPeerTimeout returns the current DialPeer timeout (or the default).
EXPERIMENTAL GetForceDirectDial returns true if the force direct dial option is set in the context.
GetNoDial returns true if the no dial option is set in the context.
GetSimultaneousConnect returns true if the simultaneous connect option is set in the context.
GetUseTransient returns true if the use transient option is set in the context.
WithAllowLimitedConn constructs a new context with an option that instructs the network that it is acceptable to use a limited connection when opening a new stream.
WithDialPeerTimeout returns a new context with the DialPeer timeout applied.
EXPERIMENTAL WithForceDirectDial constructs a new context with an option that instructs the network to attempt to force a direct connection to a peer via a dial even if a proxied connection to it already exists.
WithNoDial constructs a new context with an option that instructs the network to not attempt a new dial when opening a stream.
WithSimultaneousConnect constructs a new context with an option that instructs the transport to apply hole punching logic where applicable.
WithUseTransient constructs a new context with an option that instructs the network that it is acceptable to use a transient connection when opening a new stream.

# Constants

Deprecated: CanConnect is deprecated and will be removed in a future release.
Deprecated: CannotConnect is deprecated and will be removed in a future release.
Connected means has an open, live connection to peer.
DirInbound is for when the remote peer initiated a connection.
DirOutbound is for when the local peer initiated a connection.
DirUnknown is the default direction.
Limited means we have a transient connection to the peer, but aren't fully connected.
4 MB.
NATDeviceTypeCone indicates that the NAT device is a Cone NAT.
NATDeviceTypeSymmetric indicates that the NAT device is a Symmetric NAT.
NATDeviceTypeUnknown indicates that the type of the NAT device is unknown.
NATTransportTCP means that the NAT Device Type has been determined for the TCP Protocol.
NATTransportUDP means that the NAT Device Type has been determined for the UDP Protocol.
NotConnected means no connection to peer, and no extra information (default).
ReachabilityPrivate indicates that the node is not reachable from the public internet.
ReachabilityPublic indicates that the node is reachable from the public internet.
ReachabilityUnknown indicates that the reachability status of the node is unknown.
ReservationPriorityAlways is a reservation priority that indicates a reservation if there is enough memory, regardless of scope utilization.
ReservationPriorityHigh is a reservation priority that indicates a reservation if the scope memory utilization is at 80% or less.
ReservationPriorityLow is a reservation priority that indicates a reservation if the scope memory utilization is at 40% or less.
Reservation PriorityMedium is a reservation priority that indicates a reservation if the scope memory utilization is at 60% or less.

# Variables

DialPeerTimeout is the default timeout for a single call to `DialPeer`.
ErrLimitedConn is returned when attempting to open a stream to a peer with only a conn connection, without specifying the AllowLimitedConn option.
ErrNoConn is returned when attempting to open a stream to a peer with the NoDial option and no usable connection is available.
ErrNoRemoteAddrs is returned when there are no addresses associated with a peer during a dial.
ErrReset is returned when reading or writing on a reset stream.
ErrResourceLimitExceeded is returned when attempting to perform an operation that would exceed system resource limits.
ErrResourceScopeClosed is returned when attempting to reserve resources in a closed resource scope.
ErrTransientConn is returned when attempting to open a stream to a peer with only a transient connection, without specifying the UseTransient option.
Global noop notifiee.

# Structs

AddrDelay provides an address along with the delay after which the address should be dialed.
ConnectionState holds information about the connection.
ConnStats stores metadata pertaining to a given Conn.
NotifyBundle implements Notifiee by calling any of the functions set on it, and nop'ing if they are unset.
NullResourceManager is a stub for tests and initialization of default values.
NullScope is a stub for tests and initialization of default values.
ScopeStat is a struct containing resource accounting information.
Stats stores metadata pertaining to a given Stream / Conn.

# Interfaces

Conn is a connection to a remote peer.
ConnManagementScope is the low level interface for connection resource scopes.
ConnMultiaddrs is an interface mixin for connection types that provide multiaddr addresses for the endpoints.
ConnScope is the user view of a connection scope.
ConnScoper is the interface that one can mix into a connection interface to give it a resource management scope.
ConnSecurity is the interface that one can mix into a connection interface to give it the security methods.
ConnStat is an interface mixin for connection types that provide connection statistics.
Dialer represents a service that can dial out to peers (this is usually just a Network, but other services may not need the whole stack, and thus it becomes easier to mock).
Multiplexer wraps a net.Conn with a stream multiplexing implementation and returns a MuxedConn that supports opening multiple streams over the underlying net.Conn.
MuxedConn represents a connection to a remote peer that has been extended to support stream multiplexing.
MuxedStream is a bidirectional io pipe within a connection.
Network is the interface used to connect to the outside world.
Notifiee is an interface for an object wishing to receive notifications from a Network.
PeerScope is the interface for peer resource scopes.
ProtocolScope is the interface for protocol resource scopes.
ResourceManager is the interface to the network resource management subsystem.
ResourceScope is the interface for all scopes.
ResourceScopeSpan is a ResourceScope with a delimited span.
ResourceScopeViewer is a mixin interface providing view methods for accessing top level scopes.
ServiceScope is the interface for service resource scopes.
Stream represents a bidirectional channel between two agents in a libp2p network.
StreamManagementScope is the interface for stream resource scopes.
StreamScope is the user view of a StreamScope.

# Type aliases

Connectedness signals the capacity for a connection with a given node.
DialRanker provides a schedule of dialing the provided addresses.
Direction represents which peer in a stream initiated a connection.
NATDeviceType indicates the type of the NAT device.
NATTransportProtocol is the transport protocol for which the NAT Device Type has been determined.
Reachability indicates how reachable a node is.
StreamHandler is the type of function used to listen for streams opened by the remote side.