Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler turns a Check function into an http.Handler for the GET method at path "/health".
The status code of the healthcheck is determined by the return value of the given check function: - 500 if check is nil - 500 if check returns a non-nil error - 200 otherwise
func Run ¶
Run starts a new HTTP server that listens on opts.ListenAddr (default :5678) and responds to GET /health using the http.Handler returned by Handler(check).
Run will terminate the program if there is any error starting up the HTTP server. Run returns a callback that can be used to shutdown the HTTP server.
Types ¶
Click to show internal directories.
Click to hide internal directories.