Documentation
¶
Overview ¶
Package node maintains information about peers on the network and associated connection sessions.
Index ¶
- type Node
- type Nodes
- func (n Nodes) Add(nn *Node) Nodes
- func (n Nodes) DeleteByAddrPort(ip *netip.AddrPort) (nn Nodes, e error)
- func (n Nodes) DeleteByID(ii nonce.ID) (nn Nodes, e error)
- func (n Nodes) FindByAddrPort(id *netip.AddrPort) (no *Node)
- func (n Nodes) FindByID(i nonce.ID) (no *Node)
- func (n Nodes) Len() int
- func (n Nodes) Select(selector Selector, exit *Node, count int) (selected Nodes)
- type Selector
- type Service
- type Services
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { nonce.ID Addr string AddrPort *netip.AddrPort HeaderPub *pub.Key HeaderBytes pub.Bytes HeaderPrv *prv.Key Services ifc.Transport }
Node is a representation of a messaging counterparty. The netip.AddrPort can be nil for the case of a client node that is not in a direct open connection. For this reason all nodes are assigned an ID and will normally be handled by this except when the netip.AddrPort is known via the packet sender address.
type Nodes ¶
type Nodes []*Node
func (Nodes) DeleteByAddrPort ¶
DeleteByAddrPort deletes a node identified by a netip.AddrPort.
func (Nodes) DeleteByID ¶
DeleteByID deletes a node identified by an ID.
func (Nodes) FindByAddrPort ¶
FindByAddrPort searches for a Node by netip.AddrPort.
Click to show internal directories.
Click to hide internal directories.