Files
billit/internal/handler/health.go
2025-12-06 15:31:18 +05:30

24 lines
519 B
Go

package handler
import (
"billit/internal/database"
"net/http"
"github.com/labstack/echo/v4"
)
// HealthHandlers holds dependencies for health checks
type HealthHandlers struct {
db database.Service
}
// NewHealthHandlers creates health handlers with db access
func NewHealthHandlers(db database.Service) *HealthHandlers {
return &HealthHandlers{db: db}
}
// HealthHandler returns the health status
func (h *HealthHandlers) HealthHandler(c echo.Context) error {
return c.JSON(http.StatusOK, h.db.Health())
}