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
|
|
|
|
|
|
|
// GetLivenessHandler returns [http.Handler] for liveness probes.
|
|
|
|
GetLivenessHandler() http.Handler
|
|
|
|
// GetReadinessHandler returns [http.Handler] for readiness probes.
|
|
|
|
GetReadinessHandler() 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
|