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
22a12c2c
Commit
22a12c2c
authored
Jul 19, 2018
by
Łukasz Magiera
Committed by
Steven Allen
Sep 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi: dht: simplify the implementation
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
db721461
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
dht.go
dht.go
+4
-4
No files found.
dht.go
View file @
22a12c2c
...
...
@@ -3,21 +3,21 @@ package iface
import
(
"context"
options
"github.com/ipfs/go-ipfs/core/coreapi/interface/options"
"github.com/ipfs/go-ipfs/core/coreapi/interface/options"
peer
"gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer"
ma
"gx/ipfs/Qm
YmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr
"
pstore
"gx/ipfs/Qm
da4cPRvSRyox3SqgJN6DfSZGU5TtHufPTp9uXjFj71X6/go-libp2p-peerstore
"
)
// DhtAPI specifies the interface to the DHT
type
DhtAPI
interface
{
// FindPeer queries the DHT for all of the multiaddresses associated with a
// Peer ID
FindPeer
(
context
.
Context
,
peer
.
ID
)
(
<-
chan
ma
.
Multiaddr
,
error
)
FindPeer
(
context
.
Context
,
peer
.
ID
)
(
pstore
.
PeerInfo
,
error
)
// FindProviders finds peers in the DHT who can provide a specific value
// given a key.
FindProviders
(
context
.
Context
,
Path
,
...
options
.
DhtFindProvidersOption
)
(
<-
chan
p
eer
.
ID
,
error
)
//TODO: is path the right choice here?
FindProviders
(
context
.
Context
,
Path
,
...
options
.
DhtFindProvidersOption
)
(
<-
chan
p
store
.
PeerInfo
,
error
)
// WithNumProviders is an option for FindProviders which specifies the
// number of peers to look for. Default is 20
...
...
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