health

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

type Health

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

func New

func New(opts ...Option) *Health

func (*Health) CheckLive

func (h *Health) CheckLive(ctx context.Context) Result

func (*Health) CheckReady

func (h *Health) CheckReady(ctx context.Context) Result

type Option

type Option func(cfg *config)

func WithLiveCheck

func WithLiveCheck(check Checker) Option

func WithMaxConcurrent

func WithMaxConcurrent(maxConcurrent int) Option

func WithReadyCheck

func WithReadyCheck(check Checker) Option

type Result

type Result struct {
	Status Status
	Checks map[string][]SingleCheckResult
}

type SingleCheckResult

type SingleCheckResult struct {
	Status Status
	Err    error
	Time   time.Time
}

type Status

type Status string
const (
	StatusPass Status = "pass"
	StatusFail Status = "fail"
)

func (Status) String

func (s Status) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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