healthcheck

package
v1.56.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 102

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheck added in v1.1.0

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

HealthCheck provides an HTTP endpoint that returns the health status of the service

func New added in v1.1.0

func New() *HealthCheck

New creates a HealthCheck with the specified initial state.

func (*HealthCheck) Get added in v1.1.0

func (hc *HealthCheck) Get() Status

Get the current status of this health check

func (*HealthCheck) Handler added in v1.12.0

func (hc *HealthCheck) Handler() http.Handler

Handler creates a new HTTP handler.

func (*HealthCheck) Ready added in v1.1.0

func (hc *HealthCheck) Ready()

Ready is a shortcut for Set(Ready) (kept for backwards compatibility)

func (*HealthCheck) Set added in v1.1.0

func (hc *HealthCheck) Set(status Status)

Set a new health check status

func (*HealthCheck) SetLogger added in v1.12.0

func (hc *HealthCheck) SetLogger(logger *zap.Logger)

SetLogger initializes a logger.

type Status added in v1.1.0

type Status int

Status represents the state of the service.

const (
	// Unavailable indicates the service is not able to handle requests
	Unavailable Status = iota
	// Ready indicates the service is ready to handle requests
	Ready
	// Broken indicates that the healthcheck itself is broken, not serving HTTP
	Broken
)

func (Status) String added in v1.1.0

func (s Status) String() string

Jump to

Keyboard shortcuts

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