health

package
v1.0.0-dev.147 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
simple command

Jump to

Keyboard shortcuts

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