Introduce the Go backend (netwatch-server) with an HTTP API that accepts telemetry reports and persists them as zstd-compressed JSONL files. Reports are buffered in memory and flushed to disk when the buffer reaches 10 MiB or every 60 seconds.
12 lines
279 B
Go
12 lines
279 B
Go
package handlers
|
|
|
|
import "net/http"
|
|
|
|
// HandleHealthCheck returns a handler for the health check
|
|
// endpoint.
|
|
func (s *Handlers) HandleHealthCheck() http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
s.respondJSON(w, r, s.hc.Check(), http.StatusOK)
|
|
}
|
|
}
|