Documentation
¶
Index ¶
- Constants
- func CallRemoteNode(coords *Coords, nodesToSendRPC []string, command, key, value string) chan *AppendResult
- func Execute()
- func GetKey(w http.ResponseWriter, r *http.Request)
- func Run(cmd *cobra.Command, args []string)
- func SetKey(coords *Coords) func(http.ResponseWriter, *http.Request)
- type AppendArgument
- type AppendResult
- type Coords
- type LogEntry
- type RequestValueWithKey
- type ServerState
- type UpdateKey
- type VoteArgument
- type VoteResult
Constants ¶
View Source
const ( FOLLOWER ServerState = "FOLLOWER" CANDIDATE = "CANDIDATE" LEADER = "LEADER" )
View Source
const ( PUT = "PUT" DELETE = "DELETE" GET = "GET" )
Variables ¶
This section is empty.
Functions ¶
func CallRemoteNode ¶
func CallRemoteNode(coords *Coords, nodesToSendRPC []string, command, key, value string) chan *AppendResult
Types ¶
type AppendArgument ¶
type AppendResult ¶
type Coords ¶
type Coords struct { State ServerState Term int VotedFor interface{} // interface because it can be string or nil Log []LogEntry }
func (*Coords) AppendEntry ¶
func (c *Coords) AppendEntry(appendArg *AppendArgument, state *AppendResult) error
func (*Coords) RequestVote ¶
func (c *Coords) RequestVote(voteArg *VoteArgument, result *VoteResult) error
type RequestValueWithKey ¶
type RequestValueWithKey struct {
Key string
}
type ServerState ¶
type ServerState string
type VoteArgument ¶
type VoteResult ¶
Click to show internal directories.
Click to hide internal directories.