initial commit from original sev version

This commit is contained in:
Bartal Læarsson
2026-06-25 12:03:26 +01:00
commit 9c157cc5a0
31 changed files with 468875 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package handlers
import (
"net/http"
"time"
)
func (h *Handler) Health(writer http.ResponseWriter, request *http.Request) {
rows, lastReset, nextReset := h.store.Snapshot()
WriteJSON(writer, http.StatusOK, map[string]any{
"status": "ok",
"service": h.appName,
"version": h.version,
"dataset_count": len(rows),
"reset_interval": h.store.ResetInterval().String(),
"last_reset": lastReset.Format(time.RFC3339),
"next_reset": nextReset.Format(time.RFC3339),
})
}