package http import ( "net/http" "github.com/labstack/echo/v4" ) type healthResponse struct { Status string `json:"status"` } func healthLive(c echo.Context) error { return c.JSON(http.StatusOK, healthResponse{Status: "ok"}) } func healthReady(isReady func() bool) echo.HandlerFunc { return func(c echo.Context) error { if !isReady() { return echo.NewHTTPError(http.StatusServiceUnavailable, "Service unavailable") } return c.JSON(http.StatusOK, healthResponse{Status: "ok"}) } }