- The configuration option
WithChecks
was added. - The configuration option
WithInfoFunc
was added.
CheckerResult
sDetails
field is now no pointer anymore.- The configuration option
WithMaxErrorMessageLength
was removed. This used to control the length of the string fieldCheckResult.Error
. Instead of returning the error as a string, it is now being returned as anerror
. - All
time.Time
fields inhealth.CheckState
are now values rather than pointers. Use theIsZero
-method to check if a value has been set or not instead.
- This version introduces automatic recovery from panics that can be turned off on a per-check basis like shown in the showcase example.
- A bug has been fixed that could cause goroutine leaks for timed out check functions.
- The initial check run that is executed on startup is non-blocking anymore.
- A ResultWriter must now additionally write the status code into the http.ResponseWriter. This is necessary due to ordering constraints when writing into a http.ResponseWriter (see #9).
- Stopping the Checker does not wait until the initial delay of periodic checks has passed anymore. Checker.Stop stops the Checker immediately, but waits until all currently running check functions have completed.
- The health check http.Handler was patched to not
include an empty
checks
map in the JSON response. In case no check functions are defined, the JSON response will therefore not be{ "status": "up", "checks" : {} }
anymore but only{ "status": "up" }
. - A Kubernetes liveness and readiness checks example was added (see
examples/kubernetes
).
- Many documentation improvements
- BREAKING CHANGE: Changed function signature of middleware functions.
- Added a new check function interceptor and a http.Handler middleware with basic logging functionality.
- Added a new basic authentication middleware that reduces the exposed health information in case of failed authentication.
- Added a new middleware FullDetailsOnQueryParam was added that hides details by default and only shows them when a configured query parameter name was provided in the HTTP request.
- Added new Checker configuration option WithInterceptors, that will be applied to every check function.