Merge pull request #289 from harmony-ek/move_host_to_p2p_package
Move Host interface into the top-level p2p packagepull/293/head
commit
4b21d33495
@ -0,0 +1,13 @@ |
||||
package p2p |
||||
|
||||
import "github.com/libp2p/go-libp2p-peer" |
||||
|
||||
// Host is the client + server in p2p network.
|
||||
type Host interface { |
||||
GetSelfPeer() Peer |
||||
SendMessage(Peer, []byte) error |
||||
BindHandlerAndServe(handler StreamHandler) |
||||
Close() error |
||||
AddPeer(*Peer) error |
||||
GetID() peer.ID |
||||
} |
@ -1,16 +0,0 @@ |
||||
package host |
||||
|
||||
import ( |
||||
"github.com/harmony-one/harmony/p2p" |
||||
peer "github.com/libp2p/go-libp2p-peer" |
||||
) |
||||
|
||||
// Host is the client + server in p2p network.
|
||||
type Host interface { |
||||
GetSelfPeer() p2p.Peer |
||||
SendMessage(p2p.Peer, []byte) error |
||||
BindHandlerAndServe(handler p2p.StreamHandler) |
||||
Close() error |
||||
AddPeer(*p2p.Peer) error |
||||
GetID() peer.ID |
||||
} |
Loading…
Reference in new issue