diff --git a/README.md b/README.md index 750af72..9d20969 100644 --- a/README.md +++ b/README.md @@ -82,11 +82,11 @@ kp, _ := kubeprobes.New( // ... ) -livenessHandler := kp.GetLivenessHandler() -readinessHandler := kp.GetReadinessHandler() +livenessHandler := kp.LivenessHandler() +readinessHandler := kp.ReadinessHandler() ``` -Those handler can be used for manually mounting them on other servers/routers/muxes (eg. `go-chi/chi`, `gorilla/mux`, `http`'s `ServeMux` etc.). +Those handler can be used for manually mounting them on other servers/routers/muxes (eg. `go-chi/chi`, `gorilla/mux`, `http`'s `ServeMux` etc.). ## Example usage diff --git a/probes.go b/probes.go index e21dd89..ae59b99 100644 --- a/probes.go +++ b/probes.go @@ -93,13 +93,13 @@ func (kp *kubeprobes) handleReadiness(w http.ResponseWriter, _ *http.Request) { } } -// GetLivenessHandler implements Kubeprobes. -func (kp *kubeprobes) GetLivenessHandler() http.Handler { +// LivenessHandler implements Kubeprobes. +func (kp *kubeprobes) LivenessHandler() http.Handler { return http.HandlerFunc(kp.handleLiveness) } -// GetReadinessHandler implements Kubeprobes. -func (kp *kubeprobes) GetReadinessHandler() http.Handler { +// ReadinessHandler implements Kubeprobes. +func (kp *kubeprobes) ReadinessHandler() http.Handler { return http.HandlerFunc(kp.handleReadiness) } diff --git a/types.go b/types.go index c976a1a..cc1c862 100644 --- a/types.go +++ b/types.go @@ -6,10 +6,10 @@ import "net/http" 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 + // LivenessHandler returns [http.Handler] for liveness probes. + LivenessHandler() http.Handler + // ReadinessHandler returns [http.Handler] for readiness probes. + ReadinessHandler() http.Handler } // Option represents a [Kubeprobes] constructor option.