Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Host string
Port int
DashboardDir string
TemplateName string
ConfigFile string
Environment string
AdminPassword string
Frontend fs.FS // embedded frontend files, nil for dev mode
}
Config holds server configuration.
type DashboardSummary ¶
type DashboardSummary struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Connection string `json:"connection,omitempty"`
WidgetCount int `json:"widget_count"`
FilterCount int `json:"filter_count"`
RowCount int `json:"row_count"`
}
DashboardSummary is a lightweight representation of a dashboard for listing.
func MakeDashboardSummary ¶
func MakeDashboardSummary(d *dashboard.Dashboard) DashboardSummary
MakeDashboardSummary creates a DashboardSummary from a Dashboard.
type Invalidator ¶
type Invalidator interface {
Invalidate()
}
Invalidator is called when dashboard files change to clear stale data.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the dac HTTP server.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher monitors dashboard files for changes and broadcasts SSE events.
func NewWatcher ¶
NewWatcher creates file watchers for the given directories.
type WidgetJob ¶
type WidgetJob struct {
ID string
SQL string
Connection string
// InlineData, when set, is returned directly without executing SQL — the
// widget carries static data and needs no connection.
InlineData *dashboard.WidgetData
// ColumnRenames maps an executed result column name to the name the
// dashboard references it by. Semantic joins sanitize qualified dimension
// names (e.g. "customers.country" -> "customers_country"); this restores
// the dashboard-facing name so widgets resolve the column.
ColumnRenames map[string]string
}
WidgetJob represents a single SQL query to execute for a dashboard widget.
type WidgetQueryResult ¶
type WidgetQueryResult struct {
Columns []struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
} `json:"columns"`
Rows [][]any `json:"rows"`
Query string `json:"query,omitempty"`
Error string `json:"error,omitempty"`
}
WidgetQueryResult holds the result of executing a widget's SQL query.
func ExecuteWidgetQuery ¶
ExecuteWidgetQuery runs a single widget SQL query against the given backend. Widgets carrying inline static data are returned directly without a backend call.