func WithStatusCodeDown(httpStatus int) HandlerOption {
	return func(cfg *handlerConfig) {
		cfg.statusCodeDown = httpStatus
	}
}
WithStatusCodeDown sets an HTTP status code that will be used for responses
where the system is considered to be unavailable ("down").
Default is HTTP status code 503 (Service Unavailable).
package health
import (
	"context"
	"time"
)
type (
	Check struct {
		Name string  
		Check func(ctx context.Context) error  
		Timeout time.Duration  
		MaxTimeInError time.Duration  
		MaxContiguousFails uint  
		StatusListener func(ctx context.Context, name string, state CheckState)  
		Interceptors []Interceptor
		updateInterval time.Duration
		initialDelay   time.Duration
	}
	CheckerOption func(config *checkerConfig)
	HandlerOption func(*handlerConfig)
)
func NewChecker(options ...CheckerOption) Checker {
	cfg := checkerConfig{
		cacheTTL:     1 * time.Second,
		timeout:      30 * time.Second,
		maxErrMsgLen: 500,
		checks:       map[string]*Check{},
		interceptors: []Interceptor{},
	}
	for _, opt := range options {
		opt(&cfg)
	}
	return newDefaultChecker(cfg)
}
func WithMaxErrorMessageLength(length uint) CheckerOption {
	return func(cfg *checkerConfig) {
		cfg.maxErrMsgLen = length
	}
}
func WithDisabledDetails() CheckerOption {
	return func(cfg *checkerConfig) {
		cfg.detailsDisabled = true
	}
}
func WithTimeout(timeout time.Duration) CheckerOption {
	return func(cfg *checkerConfig) {
		cfg.timeout = timeout
	}
}
func WithStatusListener(listener func(ctx context.Context, state CheckerState)) CheckerOption {
	return func(cfg *checkerConfig) {
		cfg.statusChangeListener = listener
	}
}
func WithMiddleware(middleware ...Middleware) HandlerOption {
	return func(cfg *handlerConfig) {
		cfg.middleware = append(cfg.middleware, middleware...)
	}
}
func WithStatusCodeUp(httpStatus int) HandlerOption {
	return func(cfg *handlerConfig) {
		cfg.statusCodeUp = httpStatus
	}
}