health

package
v0.0.0-...-f79dcad Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InputToStruct

func InputToStruct[T any](input Input) (T, error)

InputToStruct converts an Input to a (typed) struct.

Types

type Checker

type Checker interface {
	// Name returns the name of the Checker.
	Name() string
	// Check executes a health check.
	Check(ctx context.Context, project, stage string, criteria Criteria) Result
}

Checker is an interface for components that implement the logic for execution of a health check.

type Criteria

type Criteria struct {
	// Kind identifies a registered Checker that implements the logic
	// for the health check process.
	Kind string
	// Input is an opaque map of values to be passed to the Checker.
	Input Input
}

Criteria describes a request for the execution of a health check by a specific Checker.

type Input

type Input map[string]any

Input is an opaque map of values used as input to a Checker.

func (Input) DeepCopy

func (i Input) DeepCopy() Input

DeepCopy returns a deep copy of the input.

func (Input) ToJSON

func (i Input) ToJSON() []byte

ToJSON marshals the input to JSON.

type Result

type Result struct {
	// Status is the high-level outcome of the HealthCheck executed by a
	// Checker.
	Status kargoapi.HealthState
	// Output is the opaque output of a HealthCheck executed by a
	// Checker. The Engine will aggregate this output and include it
	// in the final results of the health check, which will ultimately be included
	// in StageStatus.
	Output map[string]any
	// Issues is a list of issues that were encountered during the execution of
	// the health check by a Checker.
	Issues []string
}

Result represents the results of a health check executed by a Checker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳