Documentation ¶
Index ¶
- Constants
- type Fsm
- type KVStore
- type Node
- func (n *Node) Apply(cmd []byte, timeout time.Duration) error
- func (n *Node) DelByNode(node string) int
- func (n *Node) GetLeader() (addr, id string)
- func (n *Node) IsLeader() bool
- func (n *Node) Join(nodeID, addr string) error
- func (n *Node) Leave(nodeID string) error
- func (n *Node) Search(key string) []string
- func (n *Node) SetListener(listener func(op, key, value string))
- func (n *Node) Shutdown() error
- func (n *Node) Snapshot() error
- func (n *Node) Status() ([]byte, error)
- func (n *Node) WaitForApplied(timeout time.Duration) error
- func (n *Node) WaitForAppliedIndex(idx uint64, timeout time.Duration) error
- func (n *Node) WaitForLeader(timeout time.Duration) (string, error)
Constants ¶
View Source
const (
DefaultRaftTimeout = 5 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func NewRaftNode ¶
func (*Node) SetListener ¶
func (*Node) WaitForApplied ¶
WaitForApplied waits for all Raft log entries to to be applied to the underlying database.
func (*Node) WaitForAppliedIndex ¶
WaitForAppliedIndex blocks until a given log index has been applied, or the timeout expires.
Click to show internal directories.
Click to hide internal directories.