Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeHttpKVAPI ¶
func ServeHttpKVAPI(kv *KvStore, port int, confChangeC chan<- raftpb.ConfChange, errorC <-chan error)
ServeHttpKVAPI starts a key-value server with a GET/PUT API and listens.
Types ¶
type KvStore ¶
type KvStore struct {
// contains filtered or unexported fields
}
a key-value store backed by raft
func NewKVStore ¶
func (*KvStore) GetSnapshot ¶
type RaftNode ¶
type RaftNode struct { // raft backing for the commit/error channel Node raft.Node // contains filtered or unexported fields }
RaftNode is a key-value stream backed by raft
func NewRaftNode ¶
func NewRaftNode(id int, peers []string, join bool, getSnapshot func() ([]byte, error), proposeC <-chan string, confChangeC <-chan raftpb.ConfChange) (<-chan *string, <-chan error, <-chan *snap.Snapshotter, *RaftNode)
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.
func (*RaftNode) IsIDRemoved ¶
IsIDRemoved is a function
func (*RaftNode) ReportSnapshot ¶
func (rc *RaftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus)
ReportSnapshot is a function
func (*RaftNode) ReportUnreachable ¶
ReportUnreachable is a function
Click to show internal directories.
Click to hide internal directories.