Versions in this module Expand all Collapse all v0 v0.0.0 Apr 26, 2018 Changes in this version + type Address common.Hash + func CommonBitsAddr(self, other Address, prox int) (addr Address) + func CommonBitsAddrByte(self, other Address, b byte, prox int) (addr Address) + func CommonBitsAddrF(self, other Address, f func() byte, p int) (addr Address) + func KeyRange(one, other Address, proxLimit int) (start, stop Address) + func RandomAddress() Address + func RandomAddressAt(self Address, prox int) (addr Address) + func (a *Address) MarshalJSON() (out []byte, err error) + func (a *Address) UnmarshalJSON(value []byte) error + func (a Address) Bin() string + func (a Address) String() string + func (target Address) ProxCmp(a, b Address) int + type KadDb struct + Address Address + Nodes [][]*NodeRecord + type KadParams struct + BucketSize int + ConnRetryExp int + InitialRetryInterval time.Duration + MaxIdleInterval time.Duration + MaxProx int + ProxBinSize int + PurgeInterval time.Duration + func NewDefaultKadParams() *KadParams + type Kademlia struct + func New(addr Address, params *KadParams) *Kademlia + func (self *Kademlia) Add(nrs []*NodeRecord) + func (self *Kademlia) Addr() Address + func (self *Kademlia) Count() int + func (self *Kademlia) DBCount() int + func (self *Kademlia) FindClosest(target Address, max int) []Node + func (self *Kademlia) KeyRange(other Address) (start, stop Address) + func (self *Kademlia) Load(path string, cb func(*NodeRecord, Node) error) (err error) + func (self *Kademlia) Off(node Node, cb func(*NodeRecord, Node)) (err error) + func (self *Kademlia) On(node Node, cb func(*NodeRecord, Node) error) (err error) + func (self *Kademlia) Save(path string, cb func(*NodeRecord, Node)) error + func (self *Kademlia) String() string + func (self *Kademlia) Suggest() (*NodeRecord, bool, int) + type Node interface + Addr func() Address + Drop func() + LastActive func() time.Time + Url func() string + type NodeData interface + type NodeRecord struct + Addr Address + After time.Time + Meta *json.RawMessage + Seen time.Time + Url string + func (self *NodeRecord) String() string