health

package
v0.19.31 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Matches(result *health.Result) bool
	Invoke(state *ServiceState)
	Description() string
}

type ActionDefinition

type ActionDefinition struct {
	Trigger           string
	ConsecutiveEvents *uint16
	Duration          *time.Duration
	Action            string
}

func (*ActionDefinition) CreateAction

func (self *ActionDefinition) CreateAction() (Action, error)

func (*ActionDefinition) Description

func (self *ActionDefinition) Description() string

type BaseCheckDefinition

type BaseCheckDefinition struct {
	Interval time.Duration
	Actions  []*ActionDefinition
}

func (*BaseCheckDefinition) CreateActions

func (self *BaseCheckDefinition) CreateActions() ([]Action, error)

func (*BaseCheckDefinition) GetInterval

func (self *BaseCheckDefinition) GetInterval() time.Duration

type Check

type Check interface {
	Name() string
	Execute() (details interface{}, err error)
}

type CheckDefinition

type CheckDefinition interface {
	GetType() string
	GetInterval() time.Duration
	CreateCheck(name string) (Check, error)
	CreateActions() ([]Action, error)
	fmt.Stringer
}

type HttpCheckDefinition

type HttpCheckDefinition struct {
	BaseCheckDefinition `mapstructure:",squash"`
	Url                 string
	Timeout             time.Duration
	Method              string
	Body                string
	ExpectStatus        int
	ExpectBody          string
}

func (*HttpCheckDefinition) CreateCheck

func (self *HttpCheckDefinition) CreateCheck(name string) (Check, error)

func (*HttpCheckDefinition) GetType

func (self *HttpCheckDefinition) GetType() string

func (*HttpCheckDefinition) String

func (self *HttpCheckDefinition) String() string

type Manager

type Manager interface {
	RegisterServiceChecks(service *ServiceState, checkDefinitions []CheckDefinition) error
	UnregisterServiceChecks(service string)
	Shutdown()
}

func NewManager

func NewManager() Manager

type PortCheckDefinition

type PortCheckDefinition struct {
	BaseCheckDefinition `mapstructure:",squash"`
	Address             string
	Timeout             time.Duration
}

func (*PortCheckDefinition) CreateCheck

func (self *PortCheckDefinition) CreateCheck(name string) (Check, error)

func (*PortCheckDefinition) GetType

func (self *PortCheckDefinition) GetType() string

func (*PortCheckDefinition) String

func (self *PortCheckDefinition) String() string

type ServiceState

type ServiceState struct {
	Service string

	BaselinePrecedence edge.Precedence

	BaselineCost uint16
	Updater      ServiceUpdater
	// contains filtered or unexported fields
}

func NewServiceState

func NewServiceState(service string, precedence ziti.Precedence, cost uint16, updater ServiceUpdater) *ServiceState

func (*ServiceState) IsChanged

func (self *ServiceState) IsChanged() bool

func (*ServiceState) Update

func (self *ServiceState) Update()

type ServiceUpdater

type ServiceUpdater interface {
	UpdateCostAndPrecedence(cost uint16, precedence edge.Precedence) error
}

Jump to

Keyboard shortcuts

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