Versions in this module Expand all Collapse all v1 v1.15.0 Nov 22, 2021 Changes in this version + var ErrPeerRejectedHighLatency = errors.New("peer rejected; latency too high") + var ErrPeerRejectedNoCapacity = errors.New("peer rejected; insufficient capacity") + type Bucket struct + func (b *Bucket) Has(id common.PeerId) bool + func (b *Bucket) Len() int + func (b *Bucket) MoveToFront(id common.PeerId) + func (b *Bucket) Peers() []common.PeerIDAddressPair + func (b *Bucket) PopBack() common.PeerIDAddressPair + func (b *Bucket) PushFront(p common.PeerIDAddressPair) + func (b *Bucket) Remove(id common.PeerId) bool + func (b *Bucket) Split(cpl int, target common.PeerId) *Bucket + type CplRefresh struct + Cpl uint + LastRefreshAt time.Time + type RouteTable struct + Buckets []*Bucket + PeerAdded func(id common.PeerId) + PeerRemoved func(id common.PeerId) + func NewRoutingTable(bucketsize int, localID common.PeerId) *RouteTable + func (rt *RouteTable) Find(id common.PeerId) (common.PeerIDAddressPair, bool) + func (rt *RouteTable) GenRandKadId(targetCpl uint) common.PeerId + func (rt *RouteTable) GetTrackedCplsForRefresh() []CplRefresh + func (rt *RouteTable) ListPeers() []common.PeerIDAddressPair + func (rt *RouteTable) NearestPeers(id common.PeerId, count int) []common.PeerIDAddressPair + func (rt *RouteTable) Print() + func (rt *RouteTable) Remove(p common.PeerId) + func (rt *RouteTable) ResetCplRefreshedAtForID(id common.PeerId, newTime time.Time) + func (rt *RouteTable) Size() int + func (rt *RouteTable) Update(peerID common.PeerId, addr string) error