health

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustValidate

func MustValidate(ctx context.Context, includes []string) (string, bool)

MustValidate returns the validation results with the given including list.

func Register

func Register(ctx context.Context, cs Checkers) (err error)

Register registers all health checkers.

func Validate

func Validate(ctx context.Context, excludes ...string) (string, bool)

Validate returns the validation results, skips the checker if its name exists in the excluding list.

Types

type Check

type Check func(context.Context) error

Check defines the stereotype for health checking.

type Checker

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

Checker defines the operations of a health checker.

func CheckerFunc

func CheckerFunc(name string, fn Check) Checker

CheckerFunc wraps the given Check as a Checker.

type Checkers

type Checkers []Checker

Checkers holds the list of Checker.

Jump to

Keyboard shortcuts

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