Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check func() error
Check is a health/readiness check.
func DNSResolveCheck ¶
DNSResolveCheck returns a Check that makes sure the provided host can resolve to at least one IP address within the specified timeout.
func DatabasePingCheck ¶
DatabasePingCheck returns a Check that validates connectivity to a database/sql.DB using Ping().
func GoroutineCountCheck ¶
GoroutineCountCheck returns a Check that fails if too many goroutines are running (which could indicate a resource leak).
func HTTPGetCheck ¶
HTTPGetCheck returns a Check that performs an HTTP GET request against the specified URL. The check fails if the response times out or returns a non-200 status code.
type Handler ¶
type Handler interface { Routes() []*router.Route AddLivenessCheck(name string, check Check) AddReadinessCheck(name string, check Check) LiveEndpoint(ctx *gin.Context) ReadyEndpoint(ctx *gin.Context) RemoveLivenessCheck(name string) RemoveReadinessCheck(name string) }
Handler is an endpoints with additional methods that register health and readiness checks. It handles handle "/live" and "/ready" HTTP endpoints.