healthcheck

package
v0.0.0-...-34841a2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConflictCheckerName = errors.New("health checker names conflict")
	ErrCheckFailed         = errors.New("health check failed")
)

Functions

func NewHandler

func NewHandler(checkers ...Checker) jin.HandlerFunc

func Register

func Register(e *jin.Engine)

func RegisterHealthChecker

func RegisterHealthChecker(checkers ...Checker) error

Types

type Checker

type Checker interface {
	Pass() bool
	Name() string
}

type Status

type Status struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewStatus

func NewStatus(n int) *Status

func (*Status) Each

func (s *Status) Each(f func(string, StatusCode))

func (*Status) Get

func (s *Status) Get(k string) (StatusCode, bool)

func (*Status) Set

func (s *Status) Set(k string, v StatusCode)

func (*Status) String

func (s *Status) String(verbose bool) string

type StatusCode

type StatusCode int
const (
	StatusOK StatusCode = iota
	StatusExcluded
	StatusError
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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