Documentation
¶
Index ¶
- Constants
- Variables
- func IteratorNext(iter *iterator.QueryIterator[QueryData, FetchResult]) tea.Cmd
- func IteratorPrev(iter *iterator.QueryIterator[QueryData, FetchResult]) tea.Cmd
- func NewFetchTask(profile config.Profile, query string, startTime string, endTime string) tea.Cmd
- func NewPromqlFetchTask(profile config.Profile, expr, dataset, step, startTime, endTime string, ...) tea.Cmd
- func NewPromqlModeFetchTask(profile config.Profile, expr, dataset, step, startTime, endTime, mode string, ...) tea.Cmd
- func NewSQLWindowFetchTask(profile config.Profile, runID int, baseQuery string, ...) tea.Cmd
- func NewTimeRangeModel() list.Model
- func ResolvePromqlStep(step string, startTime, endTime time.Time) string
- func RunQuery(client *http.Client, profile *config.Profile, query string, startTime string, ...) (string, error)
- func SavedQueriesMenu() *tea.Program
- type FetchData
- type FetchResult
- type Filter
- type FilterBuilder
- type Item
- type Mode
- type PromqlFetchData
- type PromqlModel
- type Query
- type QueryData
- type QueryModel
- type Rule
- type RuleSet
- type StatusBar
- type TableKeyMap
- type TextAreaHelpKeys
- type TimeDisplayMode
- type TimeFilter
- type TimeInputModel
- func (m *TimeInputModel) DisplayMode() TimeDisplayMode
- func (m *TimeInputModel) EndValueUtc() string
- func (m *TimeInputModel) FocusEnd()
- func (m TimeInputModel) Init() tea.Cmd
- func (m *TimeInputModel) Navigate(key tea.KeyMsg)
- func (m *TimeInputModel) SetDisplayMode(mode TimeDisplayMode)
- func (m *TimeInputModel) SetEnd(t time.Time)
- func (m *TimeInputModel) SetInstant(v bool)
- func (m *TimeInputModel) SetStart(t time.Time)
- func (m *TimeInputModel) StartValueUtc() string
- func (m *TimeInputModel) SyncPreset()
- func (m TimeInputModel) Update(msg tea.Msg) (TimeInputModel, tea.Cmd)
- func (m TimeInputModel) View() string
Constants ¶
const ( TenMinute = -10 * time.Minute OneHour = -1 * time.Hour FiveHour = -5 * time.Hour OneDay = -24 * time.Hour ThreeDay = -72 * time.Hour )
Time-range presets — match the mock at terminal/page.tsx ViewTime. Custom… is a placeholder; selecting it leaves start/end editable.
Variables ¶
var ( FocusPrimary = ui.Adaptive(func(p ui.Palette) lipgloss.Color { return p.Accent }) FocusSecondary = ui.Adaptive(func(p ui.Palette) lipgloss.Color { return p.Accent2 }) StandardPrimary = ui.Adaptive(func(p ui.Palette) lipgloss.Color { return p.Body }) StandardSecondary = ui.Adaptive(func(p ui.Palette) lipgloss.Color { return p.Mute }) )
Theme-derived styles. All palette atoms come from pkg/ui — to swap a color, edit ui.Dark / ui.Light, not these vars.
Functions ¶
func IteratorNext ¶
func IteratorNext(iter *iterator.QueryIterator[QueryData, FetchResult]) tea.Cmd
func IteratorPrev ¶
func IteratorPrev(iter *iterator.QueryIterator[QueryData, FetchResult]) tea.Cmd
func NewFetchTask ¶
func NewPromqlFetchTask ¶
func NewPromqlFetchTask(profile config.Profile, expr, dataset, step, startTime, endTime string, instant bool) tea.Cmd
NewPromqlFetchTask returns a Bubble Tea command that fetches PromQL data asynchronously.
func NewPromqlModeFetchTask ¶
func NewSQLWindowFetchTask ¶
func NewTimeRangeModel ¶
NewTimeRangeModel creates new range list — narrow column, no title, no pagination, no filter. Title is rendered by the modal wrapper.
func ResolvePromqlStep ¶
ResolvePromqlStep converts "auto" into a standard PromQL range-query step. Valid manual step values are returned unchanged; invalid values fall back to auto.
func SavedQueriesMenu ¶
SavedQueriesMenu is a TUI which lists all available saved queries for the active user (only SQL queries )
Types ¶
type FetchResult ¶
type FetchResult int
type FilterBuilder ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents the struct of the saved query item
func QueryToApply ¶
func QueryToApply() Item
QueryToApply returns the selected saved query by user in the interactive list to apply
func QueryToDelete ¶
func QueryToDelete() Item
QueryToDelete returns the selected saved query by user in the interactive list to delete
func (Item) Description ¶
func (Item) FilterValue ¶
func (Item) SavedQueryID ¶
type PromqlFetchData ¶
type PromqlFetchData struct {
// contains filtered or unexported fields
}
PromqlFetchData is the message returned by NewPromqlFetchTask.
type PromqlModel ¶
type PromqlModel struct {
// contains filtered or unexported fields
}
PromqlModel is the Bubble Tea model for interactive PromQL queries.
func NewPromqlModel ¶
func (PromqlModel) Init ¶
func (m PromqlModel) Init() tea.Cmd
func (PromqlModel) View ¶
func (m PromqlModel) View() string
type Query ¶
type Query struct {
FilterType string `json:"filter_type"`
FilterQuery *string `json:"filter_query,omitempty"` // SQL query as string or null
FilterBuilder *FilterBuilder `json:"filter_builder,omitempty"` // Builder or null
}
type QueryModel ¶
type QueryModel struct {
// contains filtered or unexported fields
}
func NewQueryModel ¶
func (QueryModel) Init ¶
func (m QueryModel) Init() tea.Cmd
func (*QueryModel) UpdateTable ¶
func (m *QueryModel) UpdateTable(data FetchData)
func (*QueryModel) UpdateTableColumns ¶
func (m *QueryModel) UpdateTableColumns(schema []string, sample []map[string]interface{})
func (QueryModel) View ¶
func (m QueryModel) View() string
type StatusBar ¶
type StatusBar struct {
Info string // optional info string (rows, etc.)
Error string // error overrides Info on the right side
// contains filtered or unexported fields
}
func NewStatusBar ¶
type TableKeyMap ¶
type TableKeyMap struct {
RowUp key.Binding
RowDown key.Binding
PageUp key.Binding
PageDown key.Binding
PageFirst key.Binding
PageLast key.Binding
ScrollRight key.Binding
ScrollLeft key.Binding
Filter key.Binding
FilterClear key.Binding
FilterBlur key.Binding
}
func (TableKeyMap) FullHelp ¶
func (k TableKeyMap) FullHelp() [][]key.Binding
FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.
func (TableKeyMap) ShortHelp ¶
func (k TableKeyMap) ShortHelp() []key.Binding
ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.
type TextAreaHelpKeys ¶
type TextAreaHelpKeys struct{}
func (TextAreaHelpKeys) FullHelp ¶
func (k TextAreaHelpKeys) FullHelp() [][]key.Binding
FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.
func (TextAreaHelpKeys) ShortHelp ¶
func (k TextAreaHelpKeys) ShortHelp() []key.Binding
ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.
type TimeDisplayMode ¶
type TimeDisplayMode string
const ( // TimeDisplayLocal renders result timestamps in the selected local zone. TimeDisplayLocal TimeDisplayMode = "local" // TimeDisplayUTC renders result timestamps in UTC. TimeDisplayUTC TimeDisplayMode = "utc" )
type TimeFilter ¶
type TimeInputModel ¶
type TimeInputModel struct {
// contains filtered or unexported fields
}
func NewTimeInputModel ¶
func NewTimeInputModel(startTime, endTime time.Time) TimeInputModel
NewTimeInputModel creates a new model
func (*TimeInputModel) DisplayMode ¶
func (m *TimeInputModel) DisplayMode() TimeDisplayMode
func (*TimeInputModel) EndValueUtc ¶
func (m *TimeInputModel) EndValueUtc() string
func (*TimeInputModel) FocusEnd ¶
func (m *TimeInputModel) FocusEnd()
FocusEnd jumps directly to the end-time field — used by instant mode.
func (TimeInputModel) Init ¶
func (m TimeInputModel) Init() tea.Cmd
func (*TimeInputModel) Navigate ¶
func (m *TimeInputModel) Navigate(key tea.KeyMsg)
func (*TimeInputModel) SetDisplayMode ¶
func (m *TimeInputModel) SetDisplayMode(mode TimeDisplayMode)
func (*TimeInputModel) SetEnd ¶
func (m *TimeInputModel) SetEnd(t time.Time)
func (*TimeInputModel) SetInstant ¶
func (m *TimeInputModel) SetInstant(v bool)
SetInstant switches between range (start+end) and instant (end only) mode.
func (*TimeInputModel) SetStart ¶
func (m *TimeInputModel) SetStart(t time.Time)
func (*TimeInputModel) StartValueUtc ¶
func (m *TimeInputModel) StartValueUtc() string
func (*TimeInputModel) SyncPreset ¶
func (m *TimeInputModel) SyncPreset()
func (TimeInputModel) Update ¶
func (m TimeInputModel) Update(msg tea.Msg) (TimeInputModel, tea.Cmd)
func (TimeInputModel) View ¶
func (m TimeInputModel) View() string