mock

package
v0.31.0-dev0-fix0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2019 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func NewPeer(ip net.IP) *Peer

NewPeer creates and starts a new mock peer. If the ip is nil, random routable address is used.

func (*Peer) CloseConn

func (mp *Peer) CloseConn() error

func (*Peer) FlushStop

func (mp *Peer) FlushStop()

func (*Peer) Get

func (mp *Peer) Get(key string) interface{}

func (*Peer) ID

func (mp *Peer) ID() p2p.ID

func (*Peer) IsOutbound

func (mp *Peer) IsOutbound() bool

func (*Peer) IsPersistent

func (mp *Peer) IsPersistent() bool

func (*Peer) NodeInfo

func (mp *Peer) NodeInfo() p2p.NodeInfo

func (*Peer) RemoteAddr

func (mp *Peer) RemoteAddr() net.Addr

func (*Peer) RemoteIP

func (mp *Peer) RemoteIP() net.IP

func (*Peer) Send

func (mp *Peer) Send(chID byte, msgBytes []byte) bool

func (*Peer) Set

func (mp *Peer) Set(key string, value interface{})

func (*Peer) SocketAddr

func (mp *Peer) SocketAddr() *p2p.NetAddress

func (*Peer) Status

func (mp *Peer) Status() conn.ConnectionStatus

func (*Peer) TrySend

func (mp *Peer) TrySend(chID byte, msgBytes []byte) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL