1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-12 16:11:24 +08:00

Dialer for dht

dht doesn't need the whole network interface, only needs a Dialer.
(much reduced surface of possible errors)
This commit is contained in:
Juan Batiz-Benet
2014-10-21 03:13:10 -07:00
parent cc9f276f0f
commit cc5c181ae0
4 changed files with 22 additions and 17 deletions

View File

@ -48,3 +48,12 @@ type Handler srv.Handler
// Service interface for network resources.
type Service srv.Service
// Dialer service that can dial to peers
// (this is usually just a Network, but other services may not need the whole
// thing, and thus it becomes easier to mock)
type Dialer interface {
// DialPeer attempts to establish a connection to a given peer
DialPeer(peer.Peer) error
}