ЛР 5: асинхронная обработка изображений, уровень 5

This commit is contained in:
Nurlygayanova Ekaterina
2026-11-12 20:32:55 +03:00
parent 276dbdad8a
commit 7b3eab5473
115 changed files with 8847 additions and 34 deletions
+24
View File
@@ -0,0 +1,24 @@
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"})
}
}