coreapi: dht: simplify the implementation
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> This commit was moved from ipfs/interface-go-ipfs-core@22a12c2c233473aafa66ced10e222162a7711868 This commit was moved from ipfs/boxo@78b1cf5653e1cc2d8192db2b541fa09e2dbb2c7f
Łukasz Magiera committed
Jul 19, 2018 at 13:18 UTC
e8da394b2146191447cf5812e4a8bcc846effcd1
1 file changed
+4
-4
core/coreiface/dht.go
+4
-4
@@ -3,21 +3,21 @@ package iface
3
import (
4
"context"
5
6
- options "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
6
+ "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
7
8
peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer"
9
- ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr"
9
+ pstore "gx/ipfs/Qmda4cPRvSRyox3SqgJN6DfSZGU5TtHufPTp9uXjFj71X6/go-libp2p-peerstore"
10
)
11
12
// DhtAPI specifies the interface to the DHT
13
type DhtAPI interface {
14
// FindPeer queries the DHT for all of the multiaddresses associated with a
15
// Peer ID
16
- FindPeer(context.Context, peer.ID) (<-chan ma.Multiaddr, error)
16
+ FindPeer(context.Context, peer.ID) (pstore.PeerInfo, error)
17
18
// FindProviders finds peers in the DHT who can provide a specific value
19
// given a key.
20
- FindProviders(context.Context, Path, ...options.DhtFindProvidersOption) (<-chan peer.ID, error) //TODO: is path the right choice here?
20
+ FindProviders(context.Context, Path, ...options.DhtFindProvidersOption) (<-chan pstore.PeerInfo, error)
21
22
// WithNumProviders is an option for FindProviders which specifies the
23
// number of peers to look for. Default is 20