health

package
v1.0.0-dev.120 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(checker *HealthChecker)

Types

type CheckResult

type CheckResult struct {
	HealthCheck *HealthChecker
	Duration    time.Duration
	Error       error
}

func CheckAll

func CheckAll(ctx context.Context) []*CheckResult

func NewCheckResult

func NewCheckResult(healthCheck *HealthChecker, duration time.Duration, err error) *CheckResult

func (*CheckResult) IsOk

func (c *CheckResult) IsOk() bool

type Checker

type Checker interface {
	Check(ctx context.Context) error
}

type HealthChecker

type HealthChecker struct {
	Name        string
	Description string
	Checker     Checker
	Required    bool
	Enabled     bool
}

func NewHealthChecker

func NewHealthChecker(name string, description string, checker Checker, required bool, enabled bool) *HealthChecker

func (*HealthChecker) IsRequired

func (c *HealthChecker) IsRequired() bool

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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