health

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusKey       = "status"
	UnHealthyStatus = "fail"
	HealthyStatus   = "pass"
)

Variables

This section is empty.

Functions

func Serv

func Serv(hc Checker)

Serv start http server that contains ready, live and health endpoints warning: this function is blocking

Types

type Check

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

type Checker

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

func NewChecker

func NewChecker(l logr.Logger) Checker

func (*Checker) IsHealthy

func (c *Checker) IsHealthy() Health

func (*Checker) RegisterCheck

func (c *Checker) RegisterCheck(name string, check ICheck)

type FakeHealthyCheck

type FakeHealthyCheck struct {
}

func (FakeHealthyCheck) CheckHealth

func (FakeHealthyCheck) CheckHealth(context context.Context) Health

type FakeUnhealthyCheck

type FakeUnhealthyCheck struct {
}

func (FakeUnhealthyCheck) CheckHealth

func (FakeUnhealthyCheck) CheckHealth(context context.Context) Health

type Health

type Health struct {
	IsHealthy bool
	Info      map[string]any
}

Health a Health status struct

func NewHealth

func NewHealth(isHealthy bool) Health

type ICheck

type ICheck interface {
	CheckHealth(context context.Context) Health
}

Jump to

Keyboard shortcuts

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