Versions in this module Expand all Collapse all v1 v1.0.1 Mar 19, 2019 v1.0.0 Jan 11, 2019 Changes in this version + func MakeDeterministicNodeID(public net.Addr) (id [20]byte) + func NodeIdSecure(id [20]byte, ip net.IP) bool + func RandomNodeID() (id [20]byte) + func ReadNodesFromFile(fileName string) (ns []krpc.NodeInfo, err error) + func SecureNodeId(id *[20]byte, ip net.IP) + func WriteNodesToFile(ns []krpc.NodeInfo, fileName string) (err error) + type Addr interface + KRPC func() krpc.NodeAddr + String func() string + UDPAddr func() *net.UDPAddr + func GlobalBootstrapAddrs() (addrs []Addr, err error) + func NewAddr(ua *net.UDPAddr) Addr + type Announce struct + Peers chan PeersValues + func (a *Announce) Close() + func (a *Announce) NumContacted() int + type Peer = krpc.NodeAddr + type PeersValues struct + Peers []Peer + type Server struct + func NewServer(c *ServerConfig) (s *Server, err error) + func (s *Server) AddNode(ni krpc.NodeInfo) error + func (s *Server) AddNodesFromFile(fileName string) (added int, err error) + func (s *Server) Addr() net.Addr + func (s *Server) Announce(infoHash [20]byte, port int, impliedPort bool) (*Announce, error) + func (s *Server) Bootstrap() (ts TraversalStats, err error) + func (s *Server) Close() + func (s *Server) ID() [20]byte + func (s *Server) IPBlocklist() iplist.Ranger + func (s *Server) Nodes() (nis []krpc.NodeInfo) + func (s *Server) NumNodes() int + func (s *Server) Ping(node *net.UDPAddr, callback func(krpc.Msg, error)) error + func (s *Server) SetIPBlockList(list iplist.Ranger) + func (s *Server) Stats() ServerStats + func (s *Server) String() string + func (s *Server) WriteStatus(w io.Writer) + type ServerConfig struct + Conn net.PacketConn + ConnectionTracking *conntrack.Instance + IPBlocklist iplist.Ranger + NoSecurity bool + NodeId [20]byte + OnAnnouncePeer func(infoHash metainfo.Hash, peer Peer) + OnQuery func(query *krpc.Msg, source net.Addr) (propagate bool) + Passive bool + PublicIP net.IP + QueryResendDelay func() time.Duration + StartingNodes StartingNodesGetter + type ServerStats struct + BadNodes uint + GoodNodes int + Nodes int + OutboundQueriesAttempted int64 + OutstandingTransactions int + SuccessfulOutboundAnnouncePeerQueries int64 + type StartingNodesGetter func() ([]Addr, error) + type Transaction struct + type TraversalStats struct + NumAddrsTried int + NumResponses int Other modules containing this package github.com/anacrolix/dht/v2