oobe

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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 Connect

func Connect(cfg Config) (*Backend, error)

Connect creates a Backend and verifies connectivity by listing namespaces.

func (*Backend) Close

func (b *Backend) Close() error

Close is a no-op; the HTTP client has no persistent connections to release.

func (*Backend) ColumnIndexTypes

func (b *Backend) ColumnIndexTypes(namespace, table string) (map[string]string, error)

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

func (b *Backend) CurrentNamespace() string

CurrentNamespace satisfies the optional interface used by CurrentTableNamespace so that the refresh command can re-fetch the correct org after navigation.

func (*Backend) FetchTable

func (b *Backend) FetchTable(namespace, table string, limit int) (*data.Frame, error)

FetchTable loads up to limit rows of namespace.table, newest first.

func (*Backend) GetPage

func (b *Backend) GetPage() int

GetPage returns the current 0-based page index.

func (*Backend) GetPageSize

func (b *Backend) GetPageSize() int

GetPageSize returns the page size.

func (*Backend) GetTimeRange

func (b *Backend) GetTimeRange() int

GetTimeRange returns the current time range in minutes.

func (*Backend) Kind

func (b *Backend) Kind() string

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

func (b *Backend) Namespaces() ([]string, error)

Namespaces returns the single configured org as the only namespace.

func (*Backend) PrimaryKeys

func (b *Backend) PrimaryKeys(namespace, table string) ([]string, error)

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

func (b *Backend) Run(stmt string) (db.Result, error)

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) SetPage

func (b *Backend) SetPage(page int)

SetPage sets the current 0-based page index.

func (*Backend) SetPageSize

func (b *Backend) SetPageSize(n int)

func (*Backend) SetTimeRange

func (b *Backend) SetTimeRange(minutes int)

SetTimeRange sets the query time range in minutes.

func (*Backend) Tables

func (b *Backend) Tables(namespace string) ([]string, error)

Tables lists log streams in the given namespace (org).

func (*Backend) Title

func (b *Backend) Title() string

type Config

type Config struct {
	UserName string
	Password string
	Host     string
	Port     string
	Org      string
}

Config holds connection parameters for an OpenObserve server.

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

type FolderInfo struct {
	FolderID string
	Name     string
}

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

type PanelQuery struct {
	SQL    string
	XAlias string
	YAlias string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL