Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecCallback ¶
type ExecPacket ¶
type LocalConfig ¶
type LocalConfig struct { *pb.PeerConfig Peers []pb.PeerID PeerAddrs map[pb.PeerID]string ListenAddr string ID pb.PeerID Logger logger.Logger RandSeed int64 }
LocalConfig contains configurations for constructing a Peer.
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer is a member of a Raft consensus group. Its primary roles are to: 1. route incoming Raft messages 2. periodically tick the Raft RawNode 3. serve as a scheduler for Raft proposal pipeline events
func New ¶
func New( cfg *LocalConfig, t transport.Transport, n Protocol, ) *Peer
New creates a new Peer.
func (*Peer) HandleCommand ¶
func (p *Peer) HandleCommand( ctx context.Context, pkt *transpb.ClientPacket, ) (*transpb.ClientPacket, error)
func (*Peer) HandleMessage ¶
HandleMessage implements transport.MessageHandler.
type Ready ¶
type Ready struct { Messages []pb.Message OrderedCommands []ExecPacket }
type TickingTimer ¶
type TickingTimer interface { Tick() Reset() Stop() Instrument(func()) IsSet() bool }
func MakeTickingTimer ¶
func MakeTickingTimer(timeout int, onTimeout func()) TickingTimer
Click to show internal directories.
Click to hide internal directories.