tools

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheck added in v1.2.0

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

HealthCheck has methods for readiness and liveness probes

func NewHealthCheck added in v1.2.0

func NewHealthCheck(db Pinger) *HealthCheck

NewHealthCheck creates new HealthCheck

func (*HealthCheck) Liveness added in v1.2.0

func (hc *HealthCheck) Liveness(w http.ResponseWriter, _ *http.Request)

Liveness determines whether service is up

func (*HealthCheck) Readiness added in v1.2.0

func (hc *HealthCheck) Readiness(w http.ResponseWriter, r *http.Request)

Readiness determines whether service is ready

func (*HealthCheck) SetReady added in v1.2.0

func (hc *HealthCheck) SetReady(ready bool)

SetReady marks whether service accepts traffic. Set it after listeners are bound and clear it on shutdown

type Pinger added in v1.2.0

type Pinger interface {
	PingContext(ctx context.Context) error
}

Pinger checks database connectivity

Jump to

Keyboard shortcuts

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