add healthcheck service
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
|
||||
"git.loyso.art/frx/devsim/internal/probe"
|
||||
"git.loyso.art/frx/devsim/internal/store"
|
||||
)
|
||||
|
||||
@ -36,6 +37,11 @@ func (s *handlersBuilder) MountProfileHandlers() {
|
||||
s.mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
|
||||
}
|
||||
|
||||
func (s *handlersBuilder) MountProbeHandlers(r probe.Reporter) {
|
||||
s.mux.HandleFunc("/health", livenessHandler(r))
|
||||
s.mux.HandleFunc("/ready", readinessHandler(r))
|
||||
}
|
||||
|
||||
func (s *handlersBuilder) Build() http.Handler {
|
||||
return s.mux
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user