process

package
v1.4.550 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ThisHostname string

Functions

func AttemptElection

func AttemptElection() (bool, error)

AttemptElection tries to grab leadership (become active node)

func ContinuousRegistration added in v1.4.475

func ContinuousRegistration(extraInfo string, command string)

func ElectedNode

func ElectedNode() (hostname string, token string, isElected bool, err error)

ElectedNode returns the details of the elected node, as well as answering the question "is this process the elected one"?

func ExpireNodesHistory added in v1.4.500

func ExpireNodesHistory() error

ExpireNodesHistory cleans up the nodes history

func GetHash

func GetHash(input []byte) string

func GetRandomData

func GetRandomData() []byte

func GrabElection

func GrabElection() error

GrabElection forcibly grabs leadership. Use with care!!

func Reelect

func Reelect() error

Reelect clears the way for re-elections. Active node is immediately demoted.

func RegisterNode added in v1.4.475

func RegisterNode(extraInfo string, command string, firstTime bool) (sql.Result, error)

RegisterNode writes down this node in the node_health table

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"
)

type Token

type Token struct {
	Hash string
}

Token is used to identify and validate requests to this service

var ProcessToken *Token = NewToken()

func NewToken

func NewToken() *Token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL