Documentation
¶
Overview ¶
Package command provides a wrapper around the raft log that used strongly-typed commands for communicating state changes across cluster members.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotLeader = errors.New("not leader")
ErrNotLeader is the error given when trying to execute a Command on a node that is not the leader.
Functions ¶
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
The Command type represents a proto-encoded command that can be applied to a raft cluster.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
The Executor type is responsible for executing commands across the raft cluster.
func NewExecutor ¶
func NewExecutor(applier LogApplier, timeout time.Duration) *Executor
NewExecutor returns a new instance of the Executor type that will execute Command instances via the given LogApplier. The timeout is applied across all Command executions.
type LogApplier ¶
type LogApplier interface { ApplyLog(log raft.Log, timeout time.Duration) raft.ApplyFuture State() raft.RaftState }
The LogApplier interface describes types that can apply logs to the raft node.
Click to show internal directories.
Click to hide internal directories.