Documentation ¶
Index ¶
- Constants
- Variables
- func WrapTransportListener(ctx context.Context, ml tpt.Listener, local peer.ID, pstpt smux.Transport, ...) (iconn.Listener, error)
- func WrapTransportListenerWithProtector(ctx context.Context, ml tpt.Listener, local peer.ID, sk ic.PrivKey, ...) (iconn.Listener, error)
- type ConnWrapper
- type Dialer
- type ListenerConnWrapper
- type WrapFunc
Constants ¶
View Source
const ( SecioTag = "/secio/1.0.0" NoEncryptionTag = "/plaintext/1.0.0" )
Variables ¶
View Source
var (
ConnAcceptTimeout = 60 * time.Second
)
View Source
var DialTimeout = 60 * time.Second
DialTimeout is the maximum duration a Dial is allowed to take. This includes the time between dialing the raw network connection, protocol selection as well the handshake, if applicable.
Functions ¶
func WrapTransportListener ¶
Types ¶
type ConnWrapper ¶
ConnWrapper is any function that wraps a raw multiaddr connection
type Dialer ¶
type Dialer struct { // LocalPeer is the identity of the local Peer. LocalPeer peer.ID // Dialers are the sub-dialers usable by this dialer // selected in order based on the address being dialed Dialers []tpt.Dialer // PrivateKey used to initialize a secure connection. // Warning: if PrivateKey is nil, connection will not be secured. PrivateKey ci.PrivKey // Protector makes dialer part of a private network. // It includes implementation details how connection are protected. // Can be nil, then dialer is in public network. Protector ipnet.Protector // Wrapper to wrap the raw connection (optional) Wrapper WrapFunc // contains filtered or unexported fields }
Dialer is an object that can open connections. We could have a "convenience" Dial function as before, but it would have many arguments, as dialing is no longer simple (need a peerstore, a local peer, a context, a network, etc)
type ListenerConnWrapper ¶
type ListenerConnWrapper interface {
SetConnWrapper(ConnWrapper)
}
Click to show internal directories.
Click to hide internal directories.