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 Clerk ¶
type Clerk struct {
// contains filtered or unexported fields
}
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 (*LogData) Append ¶
Append :Append data to last if not exist
func (*LogData) ContainIndex ¶
ContainIndex :Reply true if term and index exist in current log, return index if exist
type RVParam ¶
RVParam
Source Files
¶
- client.go
- common.go
- doc.go
- log.go
- server.go
Click to show internal directories.
Click to hide internal directories.