Documentation
¶
Index ¶
- func HandleAPIExtensions(deps *Deps) forge.Handler
- func HandleAPIHealth(deps *Deps) forge.Handler
- func HandleAPIHistory(deps *Deps) forge.Handler
- func HandleAPIMetrics(deps *Deps) forge.Handler
- func HandleAPIMetricsReport(deps *Deps) forge.Handler
- func HandleAPIOverview(deps *Deps) forge.Handler
- func HandleAPIPrincipalHTTP(w http.ResponseWriter, r *http.Request)
- func HandleAPIServiceDetail(deps *Deps) forge.Handler
- func HandleAPIServices(deps *Deps) forge.Handler
- func HandleAPITraceDetail(deps *Deps) forge.Handler
- func HandleAPITraces(deps *Deps) forge.Handler
- func HandleExportCSV(deps *Deps) forge.Handler
- func HandleExportJSON(deps *Deps) forge.Handler
- func HandleExportPrometheus(deps *Deps) forge.Handler
- func HandleSSEEndpoint(broker *sse.Broker) forge.SSEHandler
- func HandleSSEStatus(broker *sse.Broker) forge.Handler
- func NewPrincipalHandler(opts PrincipalOptions) http.HandlerFunc
- type Config
- type Deps
- type PrincipalOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAPIExtensions ¶ added in v1.2.0
HandleAPIExtensions returns a list of all registered extensions as JSON.
func HandleAPIHealth ¶
HandleAPIHealth returns health check data as JSON.
func HandleAPIHistory ¶
HandleAPIHistory returns historical data as JSON.
func HandleAPIMetrics ¶
HandleAPIMetrics returns metrics data as JSON.
func HandleAPIMetricsReport ¶
HandleAPIMetricsReport returns comprehensive metrics report.
func HandleAPIOverview ¶
HandleAPIOverview returns overview data as JSON.
func HandleAPIPrincipalHTTP ¶ added in v1.6.4
func HandleAPIPrincipalHTTP(w http.ResponseWriter, r *http.Request)
HandleAPIPrincipalHTTP is the auth-enabled default for callers that don't configure the handler explicitly. Kept for backwards compatibility with tests and any direct route registrations.
func HandleAPIServiceDetail ¶
HandleAPIServiceDetail returns detailed information about a specific service.
func HandleAPIServices ¶
HandleAPIServices returns service list as JSON.
func HandleAPITraceDetail ¶ added in v1.2.0
HandleAPITraceDetail returns the full detail for a single trace.
func HandleAPITraces ¶ added in v1.2.0
HandleAPITraces returns a filtered list of traces and aggregate stats.
func HandleExportCSV ¶
HandleExportCSV exports dashboard service data as CSV.
func HandleExportJSON ¶
HandleExportJSON exports dashboard data as JSON.
func HandleExportPrometheus ¶
HandleExportPrometheus exports metrics in Prometheus text format.
func HandleSSEEndpoint ¶
func HandleSSEEndpoint(broker *sse.Broker) forge.SSEHandler
HandleSSEEndpoint returns the SSE handler for the dashboard event stream. This handler is registered with router.EventStream() in the extension.
func HandleSSEStatus ¶
HandleSSEStatus returns a JSON handler that reports SSE broker status.
func NewPrincipalHandler ¶ added in v1.6.4
func NewPrincipalHandler(opts PrincipalOptions) http.HandlerFunc
NewPrincipalHandler returns the GET /api/dashboard/v1/principal handler configured for a given dashboard. Slice (l) replaced the static handler so the React shell can distinguish "auth disabled" from "auth required, not signed in".
Types ¶
type Config ¶
type Config struct {
BasePath string
Title string
Theme string
CustomCSS string
EnableExport bool
EnableRealtime bool
EnableSearch bool
EnableSettings bool
EnableBridge bool
EnableAuth bool
ExportFormats []string
}
Config mirrors the dashboard config fields needed by handlers.
type Deps ¶
type Deps struct {
Registry *contributor.ContributorRegistry
Collector *collector.DataCollector
History *collector.DataHistory
TraceStore *collector.TraceStore
Config Config
}
Deps holds shared dependencies for all handlers.
type PrincipalOptions ¶ added in v1.6.4
PrincipalOptions configures the principal endpoint. AuthEnabled toggles between two response shapes:
- false: always 200 with `{authenticated:false}` (auth disabled, the shell skips the login gate and renders the layout for an anonymous user).
- true: 200 with the populated principal when a user is in context, or 401 with `{code:"UNAUTHENTICATED",loginPath:...}` when not — the shell interprets that as "render the LoginScreen".
LoginPath is the absolute URL the shell should send users to for sign-in (e.g. /<basePath>/login). Only included in the 401 envelope; ignored when auth is disabled.
RequiredRoles, if non-empty, restricts dashboard access to users carrying at least one of the listed roles. Authenticated users without any matching role get a 403 with `{code:"PERMISSION_DENIED"}` so the React shell can render an "access denied" panel instead of the dashboard. Slice (l.5) added this so authsome can wire role-gated dashboards via config.