health

package
v0.24.109 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 18 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
	Timeout  time.Duration
	Actions  []*ActionDefinition
}

func (*BaseCheckDefinition) CreateActions

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

func (*BaseCheckDefinition) GetInterval

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

func (*BaseCheckDefinition) GetTimeout added in v0.19.141

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

type Check

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

type CheckDefinition

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

type HttpCheckDefinition

type HttpCheckDefinition struct {
	BaseCheckDefinition `mapstructure:",squash"`
	Url                 string
	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)
	UnregisterServiceContextChecks(service, context string)
	Shutdown()
}

func NewManager

func NewManager() Manager

type PortCheckDefinition

type PortCheckDefinition struct {
	BaseCheckDefinition `mapstructure:",squash"`
	Address             string
}

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
	HostContext 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 NewServiceStateWithContext added in v0.19.54

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

func (*ServiceState) HandleActionResults added in v0.19.54

func (self *ServiceState) HandleActionResults(healthy bool)

func (*ServiceState) IsChanged

func (self *ServiceState) IsChanged() bool

type ServiceUpdater

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

Jump to

Keyboard shortcuts

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