Documentation
¶
Index ¶
- func NewFSM(opts FSMOpts) raft.FSM
- type FSM
- type FSMOpts
- type Opts
- type Raft
- func (r *Raft) AddVoter(id raft.ServerID, address raft.ServerAddress, prevIndex uint64, ...) error
- func (r *Raft) Apply(cmd []byte, timeout time.Duration) raft.ApplyFuture
- func (r *Raft) HasJoinedCluster() bool
- func (r *Raft) IsRaftLeader() bool
- func (r *Raft) RaftInit(ctx context.Context)
- func (r *Raft) RaftShutdown()
- func (r *Raft) RemoveServer(meta memberlist.NodeMeta) error
- func (r *Raft) TakeSnapshot() error
- type Snapshot
- type SnapshotOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
type FSMOpts ¶
type FSMOpts struct {
Config config.Config
GetState func() map[int]map[string]internal.KeyData
GetCommand func(command string) (internal.Command, error)
SetValues func(ctx context.Context, entries map[string]interface{}) error
SetExpiry func(ctx context.Context, key string, expire time.Time, touch bool)
DeleteKey func(ctx context.Context, key string) error
StartSnapshot func()
FinishSnapshot func()
SetLatestSnapshotTime func(msec int64)
GetHandlerFuncParams func(ctx context.Context, cmd []string, conn *net.Conn) internal.HandlerFuncParams
}
type Opts ¶
type Opts struct {
Config config.Config
SetValues func(ctx context.Context, entries map[string]interface{}) error
SetExpiry func(ctx context.Context, key string, expire time.Time, touch bool)
GetState func() map[int]map[string]internal.KeyData
GetCommand func(command string) (internal.Command, error)
DeleteKey func(ctx context.Context, key string) error
StartSnapshot func()
FinishSnapshot func()
SetLatestSnapshotTime func(msec int64)
GetHandlerFuncParams func(ctx context.Context, cmd []string, conn *net.Conn) internal.HandlerFuncParams
}
type Raft ¶
type Raft struct {
// contains filtered or unexported fields
}
func (*Raft) HasJoinedCluster ¶
func (*Raft) IsRaftLeader ¶
func (*Raft) RaftShutdown ¶
func (r *Raft) RaftShutdown()
func (*Raft) RemoveServer ¶
func (r *Raft) RemoveServer(meta memberlist.NodeMeta) error
func (*Raft) TakeSnapshot ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func NewFSMSnapshot ¶
func NewFSMSnapshot(opts SnapshotOpts) *Snapshot
type SnapshotOpts ¶
type SnapshotOpts struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.