Versions in this module Expand all Collapse all v0 v0.1.0 Mar 12, 2018 Changes in this version + const NodeIDBits + const Version + type Config struct + AnnounceAddr *net.UDPAddr + Bootnodes []*Node + NetRestrict *netutil.Netlist + NodeDBPath string + PrivateKey *ecdsa.PrivateKey + Unhandled chan<- ReadPacket + type Node struct + ID NodeID + IP net.IP + TCP uint16 + UDP uint16 + func MustParseNode(rawurl string) *Node + func NewNode(id NodeID, ip net.IP, udpPort, tcpPort uint16) *Node + func ParseNode(rawurl string) (*Node, error) + func (n *Node) Incomplete() bool + func (n *Node) MarshalText() ([]byte, error) + func (n *Node) String() string + func (n *Node) UnmarshalText(text []byte) error + type NodeID [NodeIDBits / 8]byte + func BytesID(b []byte) (NodeID, error) + func HexID(in string) (NodeID, error) + func MustBytesID(b []byte) NodeID + func MustHexID(in string) NodeID + func PubkeyID(pub *ecdsa.PublicKey) NodeID + func (id NodeID) Pubkey() (*ecdsa.PublicKey, error) + func (n *NodeID) UnmarshalText(text []byte) error + func (n NodeID) Bytes() []byte + func (n NodeID) GoString() string + func (n NodeID) MarshalText() ([]byte, error) + func (n NodeID) String() string + func (n NodeID) TerminalString() string + type ReadPacket struct + Addr *net.UDPAddr + Data []byte + type Table struct + func ListenUDP(c conn, cfg Config) (*Table, error) + func (tab *Table) Close() + func (tab *Table) Lookup(targetID NodeID) []*Node + func (tab *Table) ReadRandomNodes(buf []*Node) (n int) + func (tab *Table) Resolve(targetID NodeID) *Node + func (tab *Table) Self() *Node