add healthcheck service

This commit is contained in:
2024-08-17 01:44:20 +03:00
parent 25762cbae8
commit f635d4ca5b
11 changed files with 422 additions and 15 deletions

View File

@ -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
}