Files
mtusi2026lab2/internal/transport/http/health.go
T
Weinmaier_Andrew d8842a3de4
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab2: postgres, sessions, redis, persistence, stale read
2026-10-09 21:30:36 +03:00

26 lines
556 B
Go

package http
import (
"net/http"
"github.com/charawein/mtusi2026lab2/internal/transport/httputil"
)
type HealthHandler struct{}
func NewHealthHandler() *HealthHandler {
return &HealthHandler{}
}
func (h *HealthHandler) Live(w http.ResponseWriter, r *http.Request) {
httputil.WriteJSON(w, r, http.StatusOK, healthResponse{Status: "ok"})
}
func (h *HealthHandler) Ready(w http.ResponseWriter, r *http.Request) {
httputil.WriteJSON(w, r, http.StatusOK, healthResponse{Status: "ok"})
}
type healthResponse struct {
Status string `json:"status"`
}