mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-27 05:17:49 +08:00
Routing interface uses peer.PeerInfo
Providers are records that need Addresses. The routing system needs to provide -- not only the ID, but also -- the peer's Addresses. A peer.PeerInfo is a small struct to pass around a peer.ID and []ma.Multiaddr.
This commit is contained in:
parent
0b12fd65df
commit
7aca07e2be
@ -16,7 +16,7 @@ var ErrNotFound = errors.New("routing: not found")
|
||||
// IpfsRouting is the routing module interface
|
||||
// It is implemented by things like DHTs, etc.
|
||||
type IpfsRouting interface {
|
||||
FindProvidersAsync(context.Context, u.Key, int) <-chan peer.Peer
|
||||
FindProvidersAsync(context.Context, u.Key, int) <-chan peer.PeerInfo
|
||||
|
||||
// Basic Put/Get
|
||||
|
||||
@ -33,6 +33,7 @@ type IpfsRouting interface {
|
||||
Provide(context.Context, u.Key) error
|
||||
|
||||
// Find specific Peer
|
||||
// FindPeer searches for a peer with given ID.
|
||||
FindPeer(context.Context, peer.ID) (peer.Peer, error)
|
||||
// FindPeer searches for a peer with given ID, returns a peer.PeerInfo
|
||||
// with relevant addresses.
|
||||
FindPeer(context.Context, peer.ID) (peer.PeerInfo, error)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user