diff --git a/probes.go b/probes.go index 974f380..e21dd89 100644 --- a/probes.go +++ b/probes.go @@ -93,6 +93,16 @@ func (kp *kubeprobes) handleReadiness(w http.ResponseWriter, _ *http.Request) { } } +// GetLivenessHandler implements Kubeprobes. +func (kp *kubeprobes) GetLivenessHandler() http.Handler { + return http.HandlerFunc(kp.handleLiveness) +} + +// GetReadinessHandler implements Kubeprobes. +func (kp *kubeprobes) GetReadinessHandler() http.Handler { + return http.HandlerFunc(kp.handleReadiness) +} + // ServeHTTP implements Kubeprobes. func (kp *kubeprobes) ServeHTTP(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/types.go b/types.go index bd0b7ea..c976a1a 100644 --- a/types.go +++ b/types.go @@ -5,6 +5,11 @@ import "net/http" // Kubeprobes represents liveness & readiness probes handler. type Kubeprobes interface { http.Handler + + // GetLivenessHandler returns [http.Handler] for liveness probes. + GetLivenessHandler() http.Handler + // GetReadinessHandler returns [http.Handler] for readiness probes. + GetReadinessHandler() http.Handler } // Option represents a [Kubeprobes] constructor option.