提交 0013415d 作者: Juan Batiz-Benet

net/interface: move more to Dialer

上级 7d7e0511
...@@ -82,15 +82,6 @@ type Network interface { ...@@ -82,15 +82,6 @@ type Network interface {
// If ProtocolID is "", writes no header. // If ProtocolID is "", writes no header.
NewStream(ProtocolID, peer.ID) (Stream, error) NewStream(ProtocolID, peer.ID) (Stream, error)
// Peers returns the peers connected
Peers() []peer.ID
// Conns returns the connections in this Netowrk
Conns() []Conn
// ConnsToPeer returns the connections in this Netowrk for given peer.
ConnsToPeer(p peer.ID) []Conn
// BandwidthTotals returns the total number of bytes passed through // BandwidthTotals returns the total number of bytes passed through
// the network since it was instantiated // the network since it was instantiated
BandwidthTotals() (uint64, uint64) BandwidthTotals() (uint64, uint64)
...@@ -133,6 +124,15 @@ type Dialer interface { ...@@ -133,6 +124,15 @@ type Dialer interface {
// Connectedness returns a state signaling connection capabilities // Connectedness returns a state signaling connection capabilities
Connectedness(peer.ID) Connectedness Connectedness(peer.ID) Connectedness
// Peers returns the peers connected
Peers() []peer.ID
// Conns returns the connections in this Netowrk
Conns() []Conn
// ConnsToPeer returns the connections in this Netowrk for given peer.
ConnsToPeer(p peer.ID) []Conn
} }
// Connectedness signals the capacity for a connection with a given node. // Connectedness signals the capacity for a connection with a given node.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论