mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-23 03:17:43 +08:00
- Modified Godeps/Godeps.json by hand - [TEST] Updated welcome docs hash to sharness - [TEST] Updated contact doc - [TEST] disabled breaking test (t0080-repo refs local)
19 lines
511 B
Go
19 lines
511 B
Go
package queue
|
|
|
|
import peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
|
|
// 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.
|
|
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
|
|
}
|