Versions in this module Expand all Collapse all v0 v0.1.0 Jan 7, 2022 Changes in this version + func NewDefaultTicker(d time.Duration) *defaultTicker + type Config struct + DebugMode bool + ElectionTimeoutMax int64 + ElectionTimeoutMin int64 + TickIntervalMilliSec int64 + type ConfigChange struct + Op ConfigOp + Server core.Address + type ConfigOp int + const Add + const Remove + type RaftManager struct + Dispatcher dispatcher + func NewRaftMgr(cls core.Cluster, cfg Config, sm core.StateMachine, inputCh chan *Rpc) *RaftManager + func NewRaftMgrWithTicker(cls core.Cluster, cfg Config, sm core.StateMachine, inputCh chan *Rpc, ...) *RaftManager + func (m *RaftManager) GetAllEntries() []core.Entry + func (m *RaftManager) GetOthers() []core.Address + func (m *RaftManager) IsCandidate() bool + func (m *RaftManager) IsFollower() bool + func (m *RaftManager) IsLeader() bool + func (m *RaftManager) Run() + func (m *RaftManager) Stop() + type Rpc struct + Addr core.Address + Ctx context.Context + Payload interface{} + type Ticker interface + GetTickCh func() <-chan time.Time + Start func() + Stop func()