@cryptotaxi247 / kubo / commits / 550b98b7f

doc(peer)

Brian Tiger Chow committed Nov 4, 2014 at 21:39 UTC 550b98b7fd60fa1b9dade392a5a634f854f131fb
1 file changed +6
peer/peer.go
+6
@@ -56,6 +56,10 @@ type Map map[u.Key]Peer
56 // Peer represents the identity information of an IPFS Node, including
57 // ID, and relevant Addresses.
58 type Peer interface {
59 +
60 + // TODO reduce the peer interface to be read-only. Force mutations to occur
61 + // on the peer store eg. peerstore.SetLatency(peerId, value).
62 +
63 // ID returns the peer's ID
64 ID() ID
65
@@ -102,6 +106,8 @@ type peer struct {
106 privKey ic.PrivKey
107 pubKey ic.PubKey
108
109 + // TODO move latency away from peer into the package that uses it. Instead,
110 + // within that package, map from ID to latency value.
111 latency time.Duration
112
113 sync.RWMutex