tools

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheck

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

HealthCheck has methods for readiness and liveness probes

func NewHealthCheck

func NewHealthCheck(db *pgxpool.Pool) *HealthCheck

NewHealthCheck creates new HealthCheck

func (*HealthCheck) Liveness

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

Liveness determines whether service is up

func (*HealthCheck) Readiness

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

Readiness determines whether service is ready

func (*HealthCheck) SetReady added in v1.4.0

func (hc *HealthCheck) SetReady(ready bool)

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

Jump to

Keyboard shortcuts

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