Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerDistance ¶
PeerDistance is a composite struct on top of a peer ID that also contains the kad distance measured against the current peer and held as a big.Int
type PeerDistances ¶
type PeerDistances []*PeerDistance
PeerDistances represents a sortable peerDistance slice
func (PeerDistances) Less ¶
func (pd PeerDistances) Less(i, j int) bool
Less is used in sorting and returns if i-th element is less than j-th element
func (PeerDistances) Swap ¶
func (pd PeerDistances) Swap(i, j int)
Swap is used in sorting and swaps the values between the i-th position with the one found on j-th position
type SortedList ¶
SortedList holds a sorted list of elements in respect with the reference value
func (*SortedList) Len ¶
func (sl *SortedList) Len() int
Len is the number of elements in the collection.
func (*SortedList) Less ¶
func (sl *SortedList) Less(i int, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (*SortedList) SortedPeers ¶
func (sl *SortedList) SortedPeers() []peer.ID
SortedPeers get the orted list of peers
func (*SortedList) Swap ¶
func (sl *SortedList) Swap(i int, j int)
Swap swaps the elements with indexes i and j.