1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-11 23:46:39 +08:00

peer.Peer is now an interface

![](http://m.memegen.com/77n7dk.jpg)
This commit is contained in:
Juan Batiz-Benet
2014-10-20 03:26:44 -07:00
parent b1d11ccfcb
commit 9ca87fbb93
65 changed files with 538 additions and 459 deletions

View File

@ -15,19 +15,19 @@ type Network interface {
// TODO: for now, only listen on addrs in local peer when initializing.
// DialPeer attempts to establish a connection to a given peer
DialPeer(*peer.Peer) error
DialPeer(peer.Peer) error
// ClosePeer connection to peer
ClosePeer(*peer.Peer) error
ClosePeer(peer.Peer) error
// IsConnected returns whether a connection to given peer exists.
IsConnected(*peer.Peer) (bool, error)
IsConnected(peer.Peer) (bool, error)
// GetProtocols returns the protocols registered in the network.
GetProtocols() *mux.ProtocolMap
// GetPeerList returns the list of peers currently connected in this network.
GetPeerList() []*peer.Peer
GetPeerList() []peer.Peer
// GetBandwidthTotals returns the total number of bytes passed through
// the network since it was instantiated