- 20 Go source files, single 16MB binary - SQLite + FTS5 full-text search (pure Go, no CGO) - BCB integration: Selic, CDI, IPCA, USD/BRL, EUR/BRL - CVM integration: 2,524 companies from registry - Fiber v2 REST API with 42 handlers - Auto-seeds on first run (~5s for BCB + CVM) - Token bucket rate limiter, optional API key auth - Periodic sync scheduler (configurable) - Graceful shutdown, structured logging (slog) - All endpoints tested with real data
22 lines
331 B
Go
22 lines
331 B
Go
package handlers
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v2"
|
|
"github.com/sentinela-go/internal/db"
|
|
)
|
|
|
|
type Handler struct {
|
|
db *db.DB
|
|
}
|
|
|
|
func New(database *db.DB) *Handler {
|
|
return &Handler{db: database}
|
|
}
|
|
|
|
func (h *Handler) Health(c *fiber.Ctx) error {
|
|
return c.JSON(fiber.Map{
|
|
"status": "ok",
|
|
"service": "sentinela",
|
|
})
|
|
}
|