2024-03-01 23:28:31 +01:00
|
|
|
package kubeprobes
|
|
|
|
|
|
|
|
import "net/http"
|
|
|
|
|
|
|
|
// Kubeprobes represents liveness & readiness probes handler.
|
|
|
|
type Kubeprobes interface {
|
|
|
|
http.Handler
|
2024-03-01 23:38:04 +01:00
|
|
|
|
2024-03-02 15:40:57 +01:00
|
|
|
// LivenessHandler returns [http.Handler] for liveness probes.
|
|
|
|
LivenessHandler() http.Handler
|
|
|
|
// ReadinessHandler returns [http.Handler] for readiness probes.
|
|
|
|
ReadinessHandler() http.Handler
|
2024-03-01 23:28:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Option represents a [Kubeprobes] constructor option.
|
|
|
|
type Option interface {
|
|
|
|
apply(kp *kubeprobes)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ProbeFunction is a function that determines whether
|
|
|
|
// the given metric may be marked as correctly functioning.
|
|
|
|
// It not, the error should be returned.
|
|
|
|
type ProbeFunction func() error
|