Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ServerRaftSolo is the initial leader ServerRaftSolo ServerRaftState = 0 // ServerRaftCandidate when the server is candidate to election ServerRaftCandidate = 1 // ServerRaftFollower when the server is a follower ServerRaftFollower = 2 // ServerRaftLeader when the server is the leader ServerRaftLeader = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerRaftState ¶
type ServerRaftState int
ServerRaftState is the state of an OpenNebula server from a zone (See HA and Raft)
func (ServerRaftState) String ¶
func (s ServerRaftState) String() string
type ServerRaftStatus ¶
type ServerRaftStatus struct { ID int `xml:"SERVER_ID"` StateRaw int `xml:"STATE"` Term int `xml:"TERM"` Votedfor int `xml:"VOTEDFOR"` Commit int `xml:"COMMIT"` LogIndex int `xml:"LOG_INDEX"` FedlogIndex int `xml:"FEDLOG_INDEX"` }
ServerRaftStatus contains the raft status datas of a server
func (*ServerRaftStatus) State ¶
func (server *ServerRaftStatus) State() (ServerRaftState, error)
State looks up the state of the zone server and returns the ZoneServerRaftState
func (*ServerRaftStatus) StateString ¶
func (server *ServerRaftStatus) StateString() (string, error)
StateString returns the state in string format
Click to show internal directories.
Click to hide internal directories.