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
8c35696f
Commit
8c35696f
authored
Sep 17, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi swarm: rewire address listing cmds
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
a48b2a80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
key.go
key.go
+3
-0
swarm.go
swarm.go
+9
-1
No files found.
key.go
View file @
8c35696f
...
...
@@ -33,6 +33,9 @@ type KeyAPI interface {
// List lists keys stored in keystore
List
(
ctx
context
.
Context
)
([]
Key
,
error
)
// Self returns the 'main' node key
Self
(
ctx
context
.
Context
)
(
Key
,
error
)
// Remove removes keys from keystore. Returns ipns path of the removed key
Remove
(
ctx
context
.
Context
,
name
string
)
(
Key
,
error
)
}
swarm.go
View file @
8c35696f
...
...
@@ -9,12 +9,13 @@ import (
"gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol"
"gx/ipfs/QmbNepETomvmXfz1X5pHNFD2QuPqnqi47dTd94QJWSorQ3/go-libp2p-peer"
pstore
"gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore"
net
"gx/ipfs/QmfDPh144WGBqRxZb1TGDHerbMnZATrHZggAPw7putNnBq/go-libp2p-net"
)
var
(
ErrNotConnected
=
errors
.
New
(
"not connected"
)
ErrConnNotFound
=
errors
.
New
(
"conn not found"
)
)
)
// ConnectionInfo contains information about a peer
type
ConnectionInfo
interface
{
...
...
@@ -24,6 +25,9 @@ type ConnectionInfo interface {
// Address returns the multiaddress via which we are connected with the peer
Address
()
ma
.
Multiaddr
// Direction returns which way the connection was established
Direction
()
net
.
Direction
// Latency returns last known round trip time to the peer
Latency
(
context
.
Context
)
(
time
.
Duration
,
error
)
...
...
@@ -41,4 +45,8 @@ type SwarmAPI interface {
// Peers returns the list of peers we are connected to
Peers
(
context
.
Context
)
([]
ConnectionInfo
,
error
)
KnownAddrs
(
context
.
Context
)
(
map
[
peer
.
ID
][]
ma
.
Multiaddr
,
error
)
LocalAddrs
(
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