Use Middleware and Interceptors to hook into the lifecycle
mainThe library provides two ways to intercept the health check process:
Middleware (MiddlewareFunc)
Middleware intercepts calls to Checker.Check (every incoming HTTP request). It allows you to access check-related information and post-process results before they are sent as an HTTP response.
Available middlewares:
BasicAuth: Reduces exposed health details based on authentication success.CustomAuth: Same asBasicAuth, but uses an arbitrary function for authentication.FullDetailsOnQueryParam: Disables health details unless a specific query parameter is present.BasicLogger: Provides basic request-oriented logging.
Interceptors (InterceptorFunc)
Interceptors intercept calls to the individual check functions. This is useful for cross-functional code that needs access to check state information or needs to perform reusable logic during the execution of a specific component check.
Available interceptors:
BasicLogger: Provides basic component check function logging.