Documentation ¶
Index ¶
- Variables
- func AttemptElection() (bool, error)
- func ContinuousRegistration(extraInfo string)
- func ElectedNode() (hostname string, token string, isElected bool, err error)
- func GetHash(input []byte) string
- func GetRandomData() []byte
- func GrabElection() error
- func Reelect() error
- func RegisterNode(extraInfo string) (sql.Result, error)
- type HealthStatus
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var ThisHostname string
Functions ¶
func AttemptElection ¶
AttemptElection tries to grab leadership (become active node)
func ContinuousRegistration ¶ added in v1.4.475
func ContinuousRegistration(extraInfo string)
func ElectedNode ¶
ElectedNode returns the details of the elected node, as well as answering the question "is this process the elected one"?
func GetRandomData ¶
func GetRandomData() []byte
func GrabElection ¶
func GrabElection() error
GrabElection forcibly grabs leadership. Use with care!!
Types ¶
type HealthStatus ¶
type HealthStatus struct { Healthy bool Hostname string Token string IsActiveNode bool ActiveNode string Error error AvailableNodes []string }
func HealthTest ¶
func HealthTest() (*HealthStatus, error)
HealthTest attempts to write to the backend database and get a result
func SimpleHealthTest ¶
func SimpleHealthTest() (*HealthStatus, error)
Just check to make sure we can connect to the database
Click to show internal directories.
Click to hide internal directories.