checkstate

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckInfo

type CheckInfo struct {
	Name      string
	Level     plan.CheckLevel
	Status    CheckStatus
	Failures  int
	Threshold int
	ChangeID  string
}

CheckInfo provides status information about a single check.

type CheckManager

type CheckManager struct {
	// contains filtered or unexported fields
}

CheckManager starts and manages the health checks.

func NewManager

func NewManager(s *state.State, runner *state.TaskRunner) *CheckManager

NewManager creates a new check manager.

func (*CheckManager) Checks

func (m *CheckManager) Checks() ([]*CheckInfo, error)

Checks returns the list of currently-configured checks and their status, ordered by name.

func (*CheckManager) Ensure added in v1.11.0

func (m *CheckManager) Ensure() error

func (*CheckManager) NotifyCheckFailed

func (m *CheckManager) NotifyCheckFailed(f FailureFunc)

NotifyCheckFailed adds f to the list of functions that are called whenever a check hits its failure threshold.

func (*CheckManager) PlanChanged

func (m *CheckManager) PlanChanged(newPlan *plan.Plan)

PlanChanged handles updates to the plan (server configuration), stopping the previous checks and starting the new ones as required.

type CheckStatus

type CheckStatus string
const (
	CheckStatusUp   CheckStatus = "up"
	CheckStatusDown CheckStatus = "down"
)

type FailureFunc

type FailureFunc func(name string)

FailureFunc is the type of function called when a failure action is triggered.

Jump to

Keyboard shortcuts

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