Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrHealthCheckNamesConflict = errors.New("health check names conflict") ErrHealthCheckFailed = errors.New("health check failed") )
Functions ¶
func NewHandler ¶
func NewHandler(conf HandlerConfig) http.HandlerFunc
func NewLivezHandler ¶
func NewLivezHandler() http.HandlerFunc
NewLivezHandler creates a new liveness check handler that can be used to check if the application is running.
func NewReadyzHandler ¶
func NewReadyzHandler(sg storage.Storage) http.HandlerFunc
NewReadyzHandler creates a new readiness check handler that can be used to check if the application is ready to serve traffic. Currently, this feature only contains a storage check and a ping check.
Types ¶
type Check ¶
Check represents a health check that can be run to check the status of a service.
func NewStorageCheck ¶
func NewStorageCheckHandler ¶
type CheckStatuses ¶
func NewCheckStatuses ¶
func NewCheckStatuses(n int) *CheckStatuses
NewCheckStatuses creates a new CheckStatuses instance with the specified capacity.
func (*CheckStatuses) Delete ¶
func (cs *CheckStatuses) Delete(k string)
Delete deletes the specified key from the map.
func (*CheckStatuses) Each ¶
func (cs *CheckStatuses) Each(f func(k string, v bool))
Each calls the specified function for each key/value pair in the map.
func (*CheckStatuses) Get ¶
func (cs *CheckStatuses) Get(k string) (bool, bool)
Get returns the value and existence status for the specified key.
func (*CheckStatuses) Len ¶
func (cs *CheckStatuses) Len() int
Len returns the number of items in the map.
func (*CheckStatuses) Set ¶
func (cs *CheckStatuses) Set(k string, v bool)
Set sets the value for the specified key.
func (*CheckStatuses) String ¶
func (cs *CheckStatuses) String(verbose bool) string
String returns a string representation of the check statuses. If verbose is true, the output includes pass/fail status for each check.
type FailureNotification ¶
FailureNotification represents the configuration for failure notifications.
type HandlerConfig ¶
type HandlerConfig struct { Verbose bool Excludes []string Checks []Check FailureNotification }
HandlerConfig represents the configuration for the health check handler.
type StorageCheck ¶
func (*StorageCheck) Name ¶
func (s *StorageCheck) Name() string