Merge pull request #140 from libp2p/docs/routing

doc(routing): document count
This commit is contained in:
Steven Allen 2020-04-09 11:05:31 -07:00 committed by GitHub
commit eb00c1a72e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,9 @@ type ContentRouting interface {
Provide(context.Context, cid.Cid, bool) error
// Search for peers who are able to provide a given key
//
// When count is 0, this method will return an unbounded number of
// results.
FindProvidersAsync(context.Context, cid.Cid, int) <-chan peer.AddrInfo
}
@ -37,7 +40,6 @@ type ContentRouting interface {
// This can be implemented by a simple lookup table, a tracking server,
// or even a DHT.
type PeerRouting interface {
// Find specific Peer
// FindPeer searches for a peer with given ID, returns a peer.AddrInfo
// with relevant addresses.
FindPeer(context.Context, peer.ID) (peer.AddrInfo, error)