Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
coreapi swarm: missing docs, review
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
  • Loading branch information
magik6k committed Oct 2, 2018
1 parent 8c35696 commit 162cac0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ type ConnectionInfo interface {
Direction() net.Direction

// Latency returns last known round trip time to the peer
Latency(context.Context) (time.Duration, error)
Latency() (time.Duration, error)

// Streams returns list of streams established with the peer
Streams(context.Context) ([]protocol.ID, error)
Streams() ([]protocol.ID, error)
}

// SwarmAPI specifies the interface to libp2p swarm
Expand All @@ -46,7 +46,12 @@ type SwarmAPI interface {
// Peers returns the list of peers we are connected to
Peers(context.Context) ([]ConnectionInfo, error)

// KnownAddrs returns the list of all addresses this node is aware of
KnownAddrs(context.Context) (map[peer.ID][]ma.Multiaddr, error)

// LocalAddrs returns the list of announced listening addresses
LocalAddrs(context.Context) ([]ma.Multiaddr, error)

// ListenAddrs returns the list of all listening addresses
ListenAddrs(context.Context) ([]ma.Multiaddr, error)
}

0 comments on commit 162cac0

Please sign in to comment.