Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn is an extension of the net.Conn interface that provides multiaddr information, and an accessor for the transport used to create the conn
type Dialer ¶
type Dialer interface { Dial(raddr ma.Multiaddr) (Conn, error) DialContext(ctx context.Context, raddr ma.Multiaddr) (Conn, error) Matches(ma.Multiaddr) bool }
Dialer is an abstraction that is normally filled by an object containing information/options around how to perform the dial. An example would be setting TCP dial timeout for all dials made, or setting the local address that we dial out from.
type FallbackDialer ¶
type FallbackDialer struct {
// contains filtered or unexported fields
}
func (*FallbackDialer) DialContext ¶
type Listener ¶
type Listener interface { Accept() (Conn, error) Close() error Addr() net.Addr Multiaddr() ma.Multiaddr }
Listener is an interface closely resembling the net.Listener interface. The only real difference is that Accept() returns Conn's of the type in this package, and also exposes a Multiaddr method as opposed to a regular Addr method
type Transport ¶
type Transport interface { Dialer(laddr ma.Multiaddr, opts ...DialOpt) (Dialer, error) Listen(laddr ma.Multiaddr) (Listener, error) Matches(ma.Multiaddr) bool }
Transport represents any device by which you can connect to and accept connections from other peers. The built-in transports provided are TCP and UTP but many more can be implemented, sctp, audio signals, sneakernet, UDT, a network of drones carrying usb flash drives, and so on.