mirror of
https://github.com/libp2p/go-libp2p.git
synced 2025-10-07 09:01:19 +08:00
doc(routing): document count
Count == 0 now means that we search for an unbounded number of providers.
This commit is contained in:
@@ -30,6 +30,9 @@ type ContentRouting interface {
|
|||||||
Provide(context.Context, cid.Cid, bool) error
|
Provide(context.Context, cid.Cid, bool) error
|
||||||
|
|
||||||
// Search for peers who are able to provide a given key
|
// 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
|
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,
|
// This can be implemented by a simple lookup table, a tracking server,
|
||||||
// or even a DHT.
|
// or even a DHT.
|
||||||
type PeerRouting interface {
|
type PeerRouting interface {
|
||||||
// Find specific Peer
|
|
||||||
// FindPeer searches for a peer with given ID, returns a peer.AddrInfo
|
// FindPeer searches for a peer with given ID, returns a peer.AddrInfo
|
||||||
// with relevant addresses.
|
// with relevant addresses.
|
||||||
FindPeer(context.Context, peer.ID) (peer.AddrInfo, error)
|
FindPeer(context.Context, peer.ID) (peer.AddrInfo, error)
|
||||||
|
Reference in New Issue
Block a user