Dashboard

Functions

Complete public API reference for the Dashboard extension

Constructors

FunctionSignatureDescription
NewExtension(opts ...ConfigOption) forge.ExtensionCreate the dashboard extension with functional options
DefaultConfig() ConfigReturns the default configuration struct

Extension Methods

Core Accessors

MethodReturnsDescription
Registry()*contributor.ContributorRegistryContributor registry for managing local and remote contributors
Collector()*collector.DataCollectorData collector for programmatic access to overview, health, metrics, and services
History()*collector.DataHistoryHistorical data store with time-series data points

Contributor API

MethodSignatureDescription
RegisterContributor(c contributor.LocalContributor) errorRegister a local contributor with the dashboard. This is the primary API for extensions to contribute UI.

Bridge API

MethodReturnsDescription
DashboardBridge()*DashboardBridgeReturns the bridge instance for registering custom functions. Returns nil if bridge is disabled.
RegisterBridgeFunction(name string, handler any, opts ...bridge.FunctionOption) errorConvenience method to register a custom bridge function. Returns error if bridge is disabled.

Real-Time

MethodReturnsDescription
SSEBroker()*sse.BrokerSSE event broker for broadcasting real-time events. Returns nil if realtime is disabled.

Infrastructure

MethodReturnsDescription
FragmentProxy()*proxy.FragmentProxyFragment proxy for fetching remote contributor pages and widgets
RecoveryManager()*recovery.ManagerRecovery manager with circuit-breaker pattern for remote contributors
Searcher()*search.FederatedSearchFederated search engine. Returns nil if search is disabled.
SettingsAggregator()*settings.AggregatorSettings aggregator. Returns nil if settings is disabled.
Sanitizer()*security.SanitizerHTML sanitizer for remote contributor fragments
CSRFManager()*security.CSRFManagerCSRF token manager. Returns nil if CSRF is disabled.
ThemeManager()*dashtheme.ManagerTheme manager for light/dark/auto mode
ForgeUIApp()*forgeui.AppThe underlying ForgeUI application instance

Discovery

MethodSignatureDescription
SetDiscoveryService(svc dashboarddiscovery.DiscoveryService)Configure the discovery service for auto-discovering remote contributors. Call before Start().

Lifecycle

MethodSignatureDescription
Register(app forge.App) errorRegisters the extension, initializes all subsystems, validates config
Start(ctx context.Context) errorRegisters routes, starts data collection, starts discovery polling
Stop(ctx context.Context) errorStops discovery, closes SSE broker, stops data collector
Health(ctx context.Context) errorReturns nil if collector is initialized, otherwise ErrCollectorNotInitialized
Dependencies() []stringReturns []string{} (no hard dependencies)

DashboardBridge Methods

MethodSignatureDescription
Bridge()() *bridge.BridgeReturns the underlying forgeui bridge instance
Register(name string, handler any, opts ...bridge.FunctionOption) errorRegister a custom bridge function

Error Sentinels

ErrorDescription
ErrPageNotFoundRequested page does not exist
ErrWidgetNotFoundRequested widget does not exist
ErrSettingNotFoundRequested setting does not exist
ErrContributorExistsContributor with the same name is already registered
ErrContributorNotFoundContributor is not found in the registry
ErrRemoteUnreachableRemote contributor cannot be reached
ErrManifestFetchFetching a remote manifest failed
ErrDiscoveryTimeoutService discovery timed out
ErrRecoveryFailedUI recovery failed
ErrCollectorNotInitializedData collector is not initialized

REST API Endpoints

All paths are relative to the configured base path (default /dashboard).

JSON API

MethodPathDescription
GET/api/overviewApplication overview: health status, extension count, uptime, key metrics
GET/api/healthPer-extension health status with check results
GET/api/metricsCurrent metric values (counters, gauges, histograms)
GET/api/servicesList of registered services with status
GET/api/service-detail?name=XDetailed information for a specific service
GET/api/historyHistorical metric data points
GET/api/metrics-reportAggregated metrics report
GET/api/search?q=XFederated search across contributors (if search enabled)
GET/api/sse/statusSSE broker connection status

Export

MethodPathDescription
GET/export/jsonFull JSON snapshot of all dashboard data
GET/export/csvMetrics exported as CSV
GET/export/prometheusMetrics in Prometheus text exposition format

Real-Time

MethodPathDescription
GET/sseSSE event stream for live updates

Bridge

MethodPathDescription
POST/bridge/callCall a bridge function (JSON request/response)
GET/bridge/stream/Streaming bridge responses via SSE

Settings

MethodPathDescription
GET/settingsAggregated settings index page
GET/ext/:name/settings/:idContributor settings form
POST/ext/:name/settings/:idSubmit contributor settings form

How is this guide?

On this page