Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = ds.ErrNotFound
ErrNotFound signals a peer wasn't found. this is here to avoid having to leak the ds abstraction to clients of Peerstore, just for the error.
Functions ¶
This section is empty.
Types ¶
type ID ¶
ID is a byte slice representing the identity of a peer.
func DecodePrettyID ¶
DecodePrettyID returns a b58-encoded string of the ID
type Peer ¶
type Peer struct { ID ID Addresses []*ma.Multiaddr PrivKey ic.PrivKey PubKey ic.PubKey sync.RWMutex // contains filtered or unexported fields }
Peer represents the identity information of an IPFS Node, including ID, and relevant Addresses.
func (*Peer) AddAddress ¶
AddAddress adds the given Multiaddr address to Peer's addresses.
func (*Peer) GetLatency ¶
GetLatency retrieves the current latency measurement.
func (*Peer) NetAddress ¶
NetAddress returns the first Multiaddr found for a given network.
func (*Peer) SetLatency ¶
SetLatency sets the latency measurement. TODO: Instead of just keeping a single number,
keep a running average over the last hour or so
Yep, should be EWMA or something. (-jbenet)