Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connectedness ¶
type Connectedness int
Connectedness signals the capacity for a connection with a given node.
const ( // Unspecified means unable to determine connectedness. Unspecified Connectedness = iota // NotConnected means no connection to peer, and no extra information (default). NotConnected // Connected means has an open, live connection to peer. Connected // CanConnect means recently connected to peer, terminated gracefully. CanConnect // CannotConnect means recently attempted connecting but failed to connect. CannotConnect // Error means there was an error determining connectedness. Error )
func (Connectedness) String ¶
func (s Connectedness) String() string
type Module ¶
type Module interface { // ListenAddr returns listener address info for the local node. ListenAddr(context.Context) (peer.AddrInfo, error) // Peers returns a list of peers. Peers(context.Context) ([]PeerInfo, error) // FindPeer finds a peer by peer id FindPeer(context.Context, peer.ID) (PeerInfo, error) // ConnectPeer connects to a peer. ConnectPeer(context.Context, peer.AddrInfo) error // DisconnectPeer disconnects from a peer. DisconnectPeer(context.Context, peer.ID) error // Connectedness returns the connection status to a peer. Connectedness(context.Context, peer.ID) (Connectedness, error) }
Module defines the net API.
Click to show internal directories.
Click to hide internal directories.