Documentation
¶
Overview ¶
Package httpapi contains the chi router, HTTP handlers, and middleware.
Handlers are deliberately THIN: they translate HTTP <-> service calls and own no business logic (which lives in internal/service, transport-agnostic so a gRPC transport can be added later). M0 wires only health/readiness; the /api/v1 surface is filled in over subsequent milestones.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
Logger *slog.Logger
Version string
Readiness ReadinessProbe
// Services is the business-logic facade. When nil (e.g. before provisioning),
// only the health endpoints are served.
Services *service.Services
// MetricsToken, when set, guards the /metrics endpoint with a bearer token.
MetricsToken string
// AuthMiddleware guards the product endpoints (set in M8). When nil, endpoints
// are unauthenticated.
AuthMiddleware func(http.Handler) http.Handler
// SCIMHandler, when non-nil (paid editions with SCIM licensed), serves the SCIM
// 2.0 protocol at /scim/v2 with its own per-org bearer-token auth. Nil in OSS.
SCIMHandler http.Handler
}
Deps are the dependencies the router needs.
type ReadinessProbe ¶
type ReadinessProbe interface {
Check(ctx context.Context) (ready bool, components map[string]string)
}
ReadinessProbe reports the health of buktio's dependencies. The map is component -> status ("ok" | "down" | ...). It is implemented in main (M0) and by the storage/db layers in later milestones.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.