CheckHandler is an http.Handler that serves a health check endpoint at the root path, based on its checker.
type CheckHandler struct { Checker }
func (h CheckHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
Checker knows how to perform a health check.
type Checker func(req *http.Request) error
Ping returns true automatically when checked.
var Ping Checker = func(_ *http.Request) error { return nil }
Handler is an http.Handler that aggregates the results of the given checkers to the root path, and supports calling individual checkers on subpaths of the name of the checker.
Adding checks on the fly is *not* threadsafe -- use a wrapper.
type Handler struct { Checks map[string]Checker }
func (h *Handler) ServeHTTP(resp http.ResponseWriter, req *http.Request)