Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
interface-go-dms3-core
Commits
162cac01
Commit
162cac01
authored
Oct 02, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi swarm: missing docs, review
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
8c35696f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
swarm.go
swarm.go
+7
-2
No files found.
swarm.go
View file @
162cac01
...
@@ -29,10 +29,10 @@ type ConnectionInfo interface {
...
@@ -29,10 +29,10 @@ type ConnectionInfo interface {
Direction
()
net
.
Direction
Direction
()
net
.
Direction
// Latency returns last known round trip time to the peer
// 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 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
// SwarmAPI specifies the interface to libp2p swarm
...
@@ -46,7 +46,12 @@ type SwarmAPI interface {
...
@@ -46,7 +46,12 @@ type SwarmAPI interface {
// Peers returns the list of peers we are connected to
// Peers returns the list of peers we are connected to
Peers
(
context
.
Context
)
([]
ConnectionInfo
,
error
)
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
)
KnownAddrs
(
context
.
Context
)
(
map
[
peer
.
ID
][]
ma
.
Multiaddr
,
error
)
// LocalAddrs returns the list of announced listening addresses
LocalAddrs
(
context
.
Context
)
([]
ma
.
Multiaddr
,
error
)
LocalAddrs
(
context
.
Context
)
([]
ma
.
Multiaddr
,
error
)
// ListenAddrs returns the list of all listening addresses
ListenAddrs
(
context
.
Context
)
([]
ma
.
Multiaddr
,
error
)
ListenAddrs
(
context
.
Context
)
([]
ma
.
Multiaddr
,
error
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment