tendermint: github.com/tendermint/tendermint/p2p/mock Index | Files

package mock

import "github.com/tendermint/tendermint/p2p/mock"


Package Files

peer.go reactor.go

type Peer Uses

type Peer struct {

    Outbound, Persistent bool
    // contains filtered or unexported fields

func NewPeer Uses

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 Uses

func (mp *Peer) CloseConn() error

func (*Peer) FlushStop Uses

func (mp *Peer) FlushStop()

func (*Peer) Get Uses

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

func (*Peer) ID Uses

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

func (*Peer) IsOutbound Uses

func (mp *Peer) IsOutbound() bool

func (*Peer) IsPersistent Uses

func (mp *Peer) IsPersistent() bool

func (*Peer) NodeInfo Uses

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

func (*Peer) RemoteAddr Uses

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

func (*Peer) RemoteIP Uses

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

func (*Peer) Send Uses

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

func (*Peer) Set Uses

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

func (*Peer) SocketAddr Uses

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

func (*Peer) Status Uses

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

func (*Peer) TrySend Uses

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

type Reactor Uses

type Reactor struct {

func NewReactor Uses

func NewReactor() *Reactor

func (*Reactor) AddPeer Uses

func (r *Reactor) AddPeer(peer p2p.Peer)

func (*Reactor) GetChannels Uses

func (r *Reactor) GetChannels() []*conn.ChannelDescriptor

func (*Reactor) Receive Uses

func (r *Reactor) Receive(chID byte, peer p2p.Peer, msgBytes []byte)

func (*Reactor) RemovePeer Uses

func (r *Reactor) RemovePeer(peer p2p.Peer, reason interface{})

Package mock imports 6 packages (graph). Updated 2019-12-15. Refresh now. Tools for package owners.