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
3ab7f142
Commit
3ab7f142
authored
Mar 10, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi: implement swarm api
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
bc2ae0a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
coreapi.go
coreapi.go
+3
-0
swarm.go
swarm.go
+3
-3
No files found.
coreapi.go
View file @
3ab7f142
...
...
@@ -34,6 +34,9 @@ type CoreAPI interface {
// Dht returns an implementation of Dht API
Dht
()
DhtAPI
// Swarm returns an implementation of Swarm API
Swarm
()
SwarmAPI
// ResolvePath resolves the path using Unixfs resolver
ResolvePath
(
context
.
Context
,
Path
)
(
ResolvedPath
,
error
)
...
...
swarm.go
View file @
3ab7f142
package
iface
import
(
"context"
"time"
"context"
ma
"gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr"
peer
"gx/ipfs/QmZoWKhxUmZ2seW4BzX6fJkNR8hh9PsGModr7q171yq2SS/go-libp2p-peer"
)
...
...
@@ -17,11 +17,11 @@ type PeerInfo interface {
Address
()
ma
.
Multiaddr
// Latency returns last known round trip time to the peer
Latency
()
time
.
Duration
Latency
(
context
.
Context
)
(
time
.
Duration
,
error
)
// Streams returns list of streams established with the peer
// TODO: should this return multicodecs?
Streams
()
[]
string
Streams
(
context
.
Context
)
(
[]
string
,
error
)
}
// SwarmAPI specifies the interface to libp2p swarm
...
...
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