Documentation ¶
Index ¶
- Variables
- func AcquireAccessToken(publicToken string) (secretToken string, err error)
- func AttemptElection() (bool, error)
- func ContinuousRegistration(extraInfo string, command string)
- func ElectedNode() (hostname string, token string, isElected bool, err error)
- func ExpireAccessTokens() error
- func ExpireNodesHistory() error
- func GenerateAccessToken(owner string) (publicToken string, err error)
- func GetHash(input []byte) string
- func GetRandomData() []byte
- func GrabElection() error
- func ReadAvailableNodes(onlyHttpNodes bool) ([]string, error)
- func Reelect() error
- func RegisterNode(extraInfo string, command string, firstTime bool) (sql.Result, error)
- func TokenBelongsToHealthyHttpService(token string) (result bool, err error)
- func TokenIsValid(publicToken string, secretToken string) (result bool, err error)
- type HealthStatus
- type OrchestratorExecutionMode
- type Token
Constants ¶
This section is empty.
Variables ¶
var ThisHostname string
Functions ¶
func AcquireAccessToken ¶ added in v1.4.580
AcquireAccessToken attempts to acquire a hopefully free token; returning in such case the secretToken as proof of ownership.
func AttemptElection ¶
AttemptElection tries to grab leadership (become active node)
func ContinuousRegistration ¶ added in v1.4.475
func ElectedNode ¶
ElectedNode returns the details of the elected node, as well as answering the question "is this process the elected one"?
func ExpireAccessTokens ¶ added in v1.4.580
func ExpireAccessTokens() error
ExpireAccessTokens removes old, known to be uneligible tokens
func ExpireNodesHistory ¶ added in v1.4.500
func ExpireNodesHistory() error
ExpireNodesHistory cleans up the nodes history
func GenerateAccessToken ¶ added in v1.4.580
GenerateAccessToken attempts to generate a new access token and returns the public part of the token
func GetRandomData ¶
func GetRandomData() []byte
func GrabElection ¶
func GrabElection() error
GrabElection forcibly grabs leadership. Use with care!!
func ReadAvailableNodes ¶ added in v1.4.580
func Reelect ¶
func Reelect() error
Reelect clears the way for re-elections. Active node is immediately demoted.
func RegisterNode ¶ added in v1.4.475
RegisterNode writes down this node in the node_health table
func TokenBelongsToHealthyHttpService ¶ added in v1.5.6
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
type OrchestratorExecutionMode ¶ added in v1.4.500
type OrchestratorExecutionMode string
const ( OrchestratorExecutionCliMode OrchestratorExecutionMode = "CLIMode" OrchestratorExecutionHttpMode = "HttpMode" )