Documentation
¶
Overview ¶
Package raftserver provides simple rpc server with K/V value.
Index ¶
Constants ¶
View Source
const ( OK = "OK" ErrNoKey = "ErrNoKey" InvalidParam = "Invalid Parameter" )
View Source
const (
ElectionTimeOut time.Duration = 150 * time.Millisecond
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AEParam ¶
type AEParam struct { Term int LeaderID int PrevLogIndex int PrevLogTerm int Entries []string LeaderCommit int }
AEParam : For AppendEntries
type KVRaft ¶
type KVRaft struct {
// contains filtered or unexported fields
}
func StartClusterServers ¶
StartClusterServers :
func (*KVRaft) AppendEntries ¶
AppendEntries :RPC call to server to update Log Entry
type LogData ¶
type LogData struct {
// contains filtered or unexported fields
}
func NewLogData ¶
func NewLogData() *LogData
func (*LogData) ContainIndex ¶
ContainIndex :Reply true if term and index exist in current log, return index if exist
Click to show internal directories.
Click to hide internal directories.