From 550b98b7fd60fa1b9dade392a5a634f854f131fb Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Tue, 4 Nov 2014 21:39:06 -0800 Subject: [PATCH] doc(peer) --- peer/peer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/peer/peer.go b/peer/peer.go index 6a5c8a2f60b..14617dc2da3 100644 --- a/peer/peer.go +++ b/peer/peer.go @@ -56,6 +56,10 @@ type Map map[u.Key]Peer // Peer represents the identity information of an IPFS Node, including // ID, and relevant Addresses. 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() ID @@ -102,6 +106,8 @@ type peer struct { privKey ic.PrivKey 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 sync.RWMutex