Documentation ¶
Index ¶
- type Peer
- func (mp *Peer) CloseConn() error
- func (mp *Peer) FlushStop()
- func (mp *Peer) Get(key string) interface{}
- func (mp *Peer) ID() p2p.ID
- func (mp *Peer) IsOutbound() bool
- func (mp *Peer) IsPersistent() bool
- func (mp *Peer) NodeInfo() p2p.NodeInfo
- func (mp *Peer) RemoteAddr() net.Addr
- func (mp *Peer) RemoteIP() net.IP
- func (mp *Peer) Send(chID byte, msgBytes []byte) bool
- func (mp *Peer) Set(key string, value interface{})
- func (mp *Peer) SocketAddr() *p2p.NetAddress
- func (mp *Peer) Status() conn.ConnectionStatus
- func (mp *Peer) TrySend(chID byte, msgBytes []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct { *cmn.BaseService Outbound, Persistent bool // contains filtered or unexported fields }
func NewPeer ¶
NewPeer creates and starts a new mock peer. If the ip is nil, random routable address is used.
func (*Peer) IsOutbound ¶
func (*Peer) IsPersistent ¶
func (*Peer) RemoteAddr ¶
func (*Peer) SocketAddr ¶
func (mp *Peer) SocketAddr() *p2p.NetAddress
func (*Peer) Status ¶
func (mp *Peer) Status() conn.ConnectionStatus
Click to show internal directories.
Click to hide internal directories.