Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHandler = NewHandler()
DefaultHandler is the default health http handler.
View Source
var DefaultPattern = "/health"
DefaultPattern is the default health http path.
Functions ¶
func StartServer ¶
StartServer starts the http health server on the given port with the given reporters.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is an http health handler.
func (*Handler) ServeHTTP ¶
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves an http request.
func (*Handler) WithErrors ¶
WithErrors configures the handler to show the error message in the response.
type Reporter ¶
type Reporter interface { // IsHealthy emits error if application is not healthy. IsHealthy() error }
Reporter represents an a health reporter.
type ReporterFunc ¶
type ReporterFunc func() error
ReporterFunc is an adapter for anonymous functions to be used as health reporters.
func (ReporterFunc) IsHealthy ¶
func (f ReporterFunc) IsHealthy() error
IsHealthy emits error if application is not healthy.
Click to show internal directories.
Click to hide internal directories.