healthchecks

package
v0.0.0-...-937c6ff Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const SERVICE_NAME string = "HealthChecks"

Variables

View Source
var (
	HealthCheckState_Unknown   = HealthCheckState{/* contains filtered or unexported fields */}
	HealthCheckState_Unhealthy = HealthCheckState{/* contains filtered or unexported fields */}
	HealthCheckState_Degraded  = HealthCheckState{/* contains filtered or unexported fields */}
	HealthCheckState_Healthy   = HealthCheckState{/* contains filtered or unexported fields */}
)

Functions

This section is empty.

Types

type HealthCheck

type HealthCheck interface {
	Check() HealthCheckResult
}

type HealthCheckAggregatedResult

type HealthCheckAggregatedResult struct {
	State    HealthCheckState    `json:"state"`
	Duration JsonTime            `json:"duration"`
	Checks   []HealthCheckResult `json:"checks"`
}

func (*HealthCheckAggregatedResult) Add

type HealthCheckResult

type HealthCheckResult struct {
	Name     string            `json:"name"`
	State    HealthCheckState  `json:"state"`
	Duration JsonTime          `json:"duration"`
	Data     map[string]string `json:"data"`
}

type HealthCheckRunner

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

func NewFromHealthChecks

func NewFromHealthChecks(livenessChecks []HealthCheck, readinessChecks []HealthCheck) HealthCheckRunner

func (*HealthCheckRunner) AddLivenessCheck

func (runner *HealthCheckRunner) AddLivenessCheck(check HealthCheck) *HealthCheckRunner

func (*HealthCheckRunner) AddReadinessCheck

func (runner *HealthCheckRunner) AddReadinessCheck(check HealthCheck) *HealthCheckRunner

func (HealthCheckRunner) RunLivenessChecks

func (runner HealthCheckRunner) RunLivenessChecks() HealthCheckAggregatedResult

func (HealthCheckRunner) RunReadinessChecks

func (runner HealthCheckRunner) RunReadinessChecks() HealthCheckAggregatedResult

type HealthCheckState

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

func (HealthCheckState) Is

func (source HealthCheckState) Is(target HealthCheckState) bool

func (HealthCheckState) IsHealthierThan

func (source HealthCheckState) IsHealthierThan(target HealthCheckState) bool

func (HealthCheckState) IsLessHealthierThan

func (source HealthCheckState) IsLessHealthierThan(target HealthCheckState) bool

func (HealthCheckState) MarshalJSON

func (source HealthCheckState) MarshalJSON() ([]byte, error)

func (HealthCheckState) String

func (source HealthCheckState) String() string

type JsonTime

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

func NewJsonTime

func NewJsonTime(duration time.Duration) JsonTime

func (JsonTime) MarshalJSON

func (t JsonTime) MarshalJSON() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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