@cryptotaxi247 / kubo / commits / a95fe8e68

coreapi swarm: missing docs, review

License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> This commit was moved from ipfs/interface-go-ipfs-core@162cac0144b96596576bc9ec7389afaa8eb56135 This commit was moved from ipfs/boxo@9df903d67183fbb9c9ae66de11a4c62f92f7c1ee

Łukasz Magiera committed Oct 2, 2018 at 12:31 UTC a95fe8e687f56947c1356ee4f10739c541e64891
1 file changed +7 -2
core/coreiface/swarm.go
+7 -2
@@ -29,10 +29,10 @@ type ConnectionInfo interface {
29 Direction() net.Direction
30
31 // Latency returns last known round trip time to the peer
32 - Latency(context.Context) (time.Duration, error)
32 + Latency() (time.Duration, error)
33
34 // Streams returns list of streams established with the peer
35 - Streams(context.Context) ([]protocol.ID, error)
35 + Streams() ([]protocol.ID, error)
36 }
37
38 // SwarmAPI specifies the interface to libp2p swarm
@@ -46,7 +46,12 @@ type SwarmAPI interface {
46 // Peers returns the list of peers we are connected to
47 Peers(context.Context) ([]ConnectionInfo, error)
48
49 + // KnownAddrs returns the list of all addresses this node is aware of
50 KnownAddrs(context.Context) (map[peer.ID][]ma.Multiaddr, error)
51 +
52 + // LocalAddrs returns the list of announced listening addresses
53 LocalAddrs(context.Context) ([]ma.Multiaddr, error)
54 +
55 + // ListenAddrs returns the list of all listening addresses
56 ListenAddrs(context.Context) ([]ma.Multiaddr, error)
57 }