Documentation
¶
Index ¶
- type Backend
- func (b *Backend) Close() error
- func (b *Backend) ColumnIndexTypes(namespace, table string) (map[string]string, error)
- func (b *Backend) ColumnsMeta(namespace, table string) ([]db.ColumnMeta, error)
- func (b *Backend) CurrentNamespace() string
- func (b *Backend) FetchTable(namespace, table string, limit int) (*data.Frame, error)
- func (b *Backend) GetPage() int
- func (b *Backend) GetPageSize() int
- func (b *Backend) GetTimeRange() int
- func (b *Backend) Kind() string
- func (b *Backend) ListDashboardsInFolder(folderID, folderName string) ([]DashboardInfo, error)
- func (b *Backend) ListFolders() ([]FolderInfo, error)
- func (b *Backend) Namespaces() ([]string, error)
- func (b *Backend) PrimaryKeys(namespace, table string) ([]string, error)
- func (b *Backend) QueryPanel(ctx PanelQueryContext) ([]map[string]any, error)
- func (b *Backend) ResetTimeWindow()
- func (b *Backend) Run(stmt string) (db.Result, error)
- func (b *Backend) SetPage(page int)
- func (b *Backend) SetPageSize(n int)
- func (b *Backend) SetTimeRange(minutes int)
- func (b *Backend) Tables(namespace string) ([]string, error)
- func (b *Backend) Title() string
- type Config
- type DashboardInfo
- type FolderInfo
- type Panel
- type PanelQuery
- type PanelQueryContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend adapts OpenObserve to the db.Backend contract.
func (*Backend) ColumnIndexTypes ¶
ColumnIndexTypes returns {"_timestamp": "INDEX"} for every stream.
func (*Backend) ColumnsMeta ¶
func (b *Backend) ColumnsMeta(namespace, table string) ([]db.ColumnMeta, error)
ColumnsMeta returns column metadata for a log stream via its schema endpoint.
func (*Backend) CurrentNamespace ¶
CurrentNamespace satisfies the optional interface used by CurrentTableNamespace so that the refresh command can re-fetch the correct org after navigation.
func (*Backend) FetchTable ¶
FetchTable loads up to limit rows of namespace.table, newest first.
func (*Backend) GetPageSize ¶
GetPageSize returns the page size.
func (*Backend) GetTimeRange ¶
GetTimeRange returns the current time range in minutes.
func (*Backend) ListDashboardsInFolder ¶
func (b *Backend) ListDashboardsInFolder(folderID, folderName string) ([]DashboardInfo, error)
ListDashboardsInFolder returns all dashboards in a folder, with panels pre-populated.
func (*Backend) ListFolders ¶
func (b *Backend) ListFolders() ([]FolderInfo, error)
ListFolders returns all dashboard folders for the configured org.
func (*Backend) Namespaces ¶
Namespaces returns the single configured org as the only namespace.
func (*Backend) PrimaryKeys ¶
PrimaryKeys returns ["_timestamp"] as the logical primary key for every stream.
func (*Backend) QueryPanel ¶
func (b *Backend) QueryPanel(ctx PanelQueryContext) ([]map[string]any, error)
QueryPanel executes a panel SQL query over the current time window.
func (*Backend) ResetTimeWindow ¶
func (b *Backend) ResetTimeWindow()
ResetTimeWindow recalculates the query time window to end NOW. Called on explicit refresh (r key) or when the time-range setting changes.
func (*Backend) Run ¶
Run executes a SQL statement. For OpenObserve all statements are read-only queries sent over the SSE search endpoint against the last 15 minutes.
func (*Backend) SetPageSize ¶
func (*Backend) SetTimeRange ¶
SetTimeRange sets the query time range in minutes.
type DashboardInfo ¶
type DashboardInfo struct {
DashboardID string
Title string
FolderID string
FolderName string
Panels []Panel // extracted from the non-null version object
}
DashboardInfo is a summary of one dashboard.
type FolderInfo ¶
FolderInfo is a dashboard folder.
type Panel ¶
type Panel struct {
ID string
Type string
Title string
Queries []PanelQuery
}
Panel is a single visualization panel inside a dashboard.
type PanelQuery ¶
PanelQuery holds one query attached to a panel.
type PanelQueryContext ¶
type PanelQueryContext struct {
DashboardID string
DashboardName string
FolderID string
FolderName string
PanelID string
PanelName string
FallbackCol string // first x-axis alias or "_timestamp"
SQL string
}
PanelQueryContext carries everything needed to build the panel search URL.