v1.51.0 Latest Latest

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 99




This section is empty.


This section is empty.


This section is empty.


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
	// Broken indicates that the healthcheck itself is broken, not serving HTTP

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