Documentation ¶
Index ¶
- type FSMSnapshot
- type OptionFn
- type Raft
- func (b *Raft) AddPeer(addr string) error
- func (b *Raft) Addr() string
- func (b *Raft) Apply(cmd jocko.RaftCommand) error
- func (b *Raft) Bootstrap(peers []*jocko.ClusterMember, commandCh chan<- jocko.RaftCommand, ...) (err error)
- func (b *Raft) IsLeader() bool
- func (b *Raft) LeaderID() string
- func (b *Raft) RemovePeer(addr string) error
- func (b *Raft) Shutdown() error
- func (b *Raft) WaitForBarrier() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSMSnapshot ¶
type FSMSnapshot struct { }
func (*FSMSnapshot) Persist ¶
func (f *FSMSnapshot) Persist(sink raft.SnapshotSink) error
func (*FSMSnapshot) Release ¶
func (f *FSMSnapshot) Release()
type Raft ¶
type Raft struct {
// contains filtered or unexported fields
}
Raft manages consensus on Jocko cluster using Hashicorp Raft
func (*Raft) Apply ¶
func (b *Raft) Apply(cmd jocko.RaftCommand) error
Apply command to all raft nodes
func (*Raft) Bootstrap ¶
func (b *Raft) Bootstrap(peers []*jocko.ClusterMember, commandCh chan<- jocko.RaftCommand, leaderCh chan<- bool) (err error)
Bootstrap the Raft agent using fsm and connect to peers Updates to leadership are returned on leaderCh channel Commands received by raft are returned on commandCh channel
func (*Raft) RemovePeer ¶
RemovePeer of given address from raft
func (*Raft) WaitForBarrier ¶
WaitForBarrier to let fsm finish
Click to show internal directories.
Click to hide internal directories.