Commit 550b98b7 authored by Brian Tiger Chow's avatar Brian Tiger Chow

doc(peer)

parent 074722cf
...@@ -56,6 +56,10 @@ type Map map[u.Key]Peer ...@@ -56,6 +56,10 @@ type Map map[u.Key]Peer
// Peer represents the identity information of an IPFS Node, including // Peer represents the identity information of an IPFS Node, including
// ID, and relevant Addresses. // ID, and relevant Addresses.
type Peer interface { type Peer interface {
// TODO reduce the peer interface to be read-only. Force mutations to occur
// on the peer store eg. peerstore.SetLatency(peerId, value).
// ID returns the peer's ID // ID returns the peer's ID
ID() ID ID() ID
...@@ -102,6 +106,8 @@ type peer struct { ...@@ -102,6 +106,8 @@ type peer struct {
privKey ic.PrivKey privKey ic.PrivKey
pubKey ic.PubKey pubKey ic.PubKey
// TODO move latency away from peer into the package that uses it. Instead,
// within that package, map from ID to latency value.
latency time.Duration latency time.Duration
sync.RWMutex sync.RWMutex
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment