Versions in this module Expand all Collapse all v0 v0.0.4 Nov 4, 2021 Changes in this version + const RejectSecs + type EvictedElement struct + EvictedAt int64 + PeerId address.PeerId type PeerBucketInfo + func (pbi *PeerBucketInfo) SyncWith(pbl PeerBucketInfo) PeerBucketInfo + type RejectMap struct + func NewRejectMap() *RejectMap + func (r *RejectMap) Add(id address.PeerId) + func (r *RejectMap) IsPeerRecentlyEvicted(id address.PeerId) bool v0.0.3 Oct 21, 2021 Changes in this version + const MaxRetries + const RetryPoolLen + var ErrCplCompute = errors.New("error while cpl compute") + var ErrManipulation = errors.New("bucket: error while manipulation or casting") + var ErrNotFound = errors.New("bucket: id not found") + type Bucket struct + Cpl int + func NewBucket(cpl, bucketSize int) *Bucket + func (b *Bucket) Access(id address.PeerId) error + func (b *Bucket) AddOrUpdate(info PeerBucketInfo, abstainLock bool) error + func (b *Bucket) CanAdd() bool + func (b *Bucket) Delete(id address.PeerId) error + func (b *Bucket) GetAll() ([]PeerBucketInfo, error) + type PeerBucketInfo struct + LastAliveAt int64 + NumRetries int64 + PeerAddr address.PeerAddressInfo + func WrapPeerAddrInfo(info address.PeerAddressInfo) PeerBucketInfo + type PeerBucketInfoList struct + func (pbl *PeerBucketInfoList) Len() int + func (pbl *PeerBucketInfoList) Less(i, j int) bool + func (pbl *PeerBucketInfoList) Swap(i, j int) + type PeerStatus int + type RoutingTable struct + func NewRoutingTable(homeNodeId address.PeerId, k int) *RoutingTable + func (rt *RoutingTable) AccessPeer(id address.PeerId) error + func (rt *RoutingTable) Add(info PeerBucketInfo) error + func (rt *RoutingTable) GetAllPeers() ([]PeerBucketInfo, error) + func (rt *RoutingTable) GetClosestTo(nodeTgt []byte) ([]PeerBucketInfo, error) + func (rt *RoutingTable) Remove(id address.PeerId) error + func (rt *RoutingTable) SortByDistanceFromTarget(target []byte, list []PeerBucketInfo) []PeerBucketInfo