Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerQueue ¶
type PeerQueue interface { // Len returns the number of items in PeerQueue Len() int // Enqueue adds this node to the queue. Enqueue(peer.ID) // Dequeue retrieves the highest (smallest int) priority node Dequeue() peer.ID }
PeerQueue maintains a set of peers ordered according to a metric. Implementations of PeerQueue could order peers based on distances along a KeySpace, latency measurements, trustworthiness, reputation, etc.
func NewXORDistancePQ ¶
NewXORDistancePQ returns a PeerQueue which maintains its peers sorted in terms of their distances to each other in an XORKeySpace (i.e. using XOR as a metric of distance).
Click to show internal directories.
Click to hide internal directories.