Commit 22a12c2c authored by Łukasz Magiera's avatar Łukasz Magiera Committed by Steven Allen

coreapi: dht: simplify the implementation

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent db721461
...@@ -3,21 +3,21 @@ package iface ...@@ -3,21 +3,21 @@ package iface
import ( import (
"context" "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" peer "gx/ipfs/QmQsErDt8Qgw1XrsXf2BpEzDgGWtB1YLsTAARBup5b6B9W/go-libp2p-peer"
ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" pstore "gx/ipfs/Qmda4cPRvSRyox3SqgJN6DfSZGU5TtHufPTp9uXjFj71X6/go-libp2p-peerstore"
) )
// DhtAPI specifies the interface to the DHT // DhtAPI specifies the interface to the DHT
type DhtAPI interface { type DhtAPI interface {
// FindPeer queries the DHT for all of the multiaddresses associated with a // FindPeer queries the DHT for all of the multiaddresses associated with a
// Peer ID // 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 // FindProviders finds peers in the DHT who can provide a specific value
// given a key. // given a key.
FindProviders(context.Context, Path, ...options.DhtFindProvidersOption) (<-chan peer.ID, error) //TODO: is path the right choice here? FindProviders(context.Context, Path, ...options.DhtFindProvidersOption) (<-chan pstore.PeerInfo, error)
// WithNumProviders is an option for FindProviders which specifies the // WithNumProviders is an option for FindProviders which specifies the
// number of peers to look for. Default is 20 // number of peers to look for. Default is 20
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment