Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfig ¶
func NewConfig() configx.Entrypoint
func NewRaftNode ¶
func NewRaftNode(id int, cluster []string, service string, join bool, getSnapshot func() ([]byte, error), proposeC <-chan string, confChangeC <-chan raftpb.ConfChange) (<-chan *commit, <-chan error, <-chan *snap.Snapshotter)
NewRaftNode initiates a raft instance and returns a committed log entry channel and error channel. Proposals for log updates are sent over the provided the proposal channel. All log entries are replayed over the commit channel, followed by a nil message (to indicate the channel is current), then new log entries. To shutdown, close proposeC and read errorC.
Types ¶
type KVStore ¶
type KVStore struct {
// contains filtered or unexported fields
}
a key-value store backed by raft
func NewKVStore ¶
func (*KVStore) GetSnapshot ¶
Click to show internal directories.
Click to hide internal directories.