Documentation
¶
Index ¶
- Variables
- func ApplyTheme(t Theme)
- func LevelStyle(level string) lipgloss.Style
- func RenderAppBackground(content string, width, height int) string
- type Completer
- type DetailView
- func (d *DetailView) EnterPickMode(items []trace.IDField)
- func (d *DetailView) ExitPickMode()
- func (d *DetailView) IsTreeMode() bool
- func (d *DetailView) PickDown()
- func (d *DetailView) PickSelected() trace.IDField
- func (d *DetailView) PickUp()
- func (d *DetailView) SelectedDotPath() string
- func (d *DetailView) SetHighlights(h []HighlightTerm)
- func (d *DetailView) SetRecord(r *parser.Record)
- func (d *DetailView) SetSize(w, h int)
- func (d *DetailView) TreeCollapse()
- func (d *DetailView) TreeDown()
- func (d *DetailView) TreeExpand()
- func (d *DetailView) TreeToggle()
- func (d *DetailView) TreeUp()
- func (d DetailView) View() string
- type Focus
- type HighlightTerm
- type Histogram
- type KeyMap
- type LogView
- func (lv *LogView) GoToEnd()
- func (lv *LogView) GoToStart()
- func (lv *LogView) ScrollDown(n int)
- func (lv *LogView) ScrollUp(n int)
- func (lv *LogView) SelectedRecordIndex() int
- func (lv *LogView) SetBookmarks(bm map[int]bool)
- func (lv *LogView) SetColumns(cols []string)
- func (lv *LogView) SetHighlights(h []HighlightTerm)
- func (lv *LogView) SetResults(records []parser.Record, results []int)
- func (lv *LogView) SetSize(w, h int)
- func (lv *LogView) SetTraceOrigin(idx int)
- func (lv *LogView) View() string
- type Model
- func (m Model) Init() tea.Cmd
- func (m *Model) SetAliases(reg *alias.Registry)
- func (m *Model) SetColumns(cols []string)
- func (m *Model) SetFollowReader(fr *input.FollowReader)
- func (m *Model) SetHistory(entries []string, path string)
- func (m *Model) SetTraceFields(fields []string)
- func (m *Model) SetViews(views []SavedView)
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type PatternView
- func (pv *PatternView) GoToEnd()
- func (pv *PatternView) GoToStart()
- func (pv *PatternView) ScrollDown(n int)
- func (pv *PatternView) ScrollUp(n int)
- func (pv *PatternView) SelectedCluster() *pattern.Cluster
- func (pv *PatternView) SetClusters(clusters []pattern.Cluster, total int)
- func (pv *PatternView) SetSize(w, h int)
- func (pv *PatternView) View() string
- type QueryBar
- func (qb *QueryBar) AcceptCompletion() bool
- func (qb *QueryBar) Blur()
- func (qb *QueryBar) CycleCompletion()
- func (qb *QueryBar) Focus()
- func (qb *QueryBar) Focused() bool
- func (qb *QueryBar) History() []string
- func (qb *QueryBar) HistoryDown() bool
- func (qb *QueryBar) HistoryUp() bool
- func (qb *QueryBar) PushHistory(q string)
- func (qb *QueryBar) SetAliases(reg *alias.Registry)
- func (qb *QueryBar) SetError(msg string)
- func (qb *QueryBar) SetHistory(entries []string)
- func (qb *QueryBar) SetValue(v string)
- func (qb *QueryBar) SetWidth(w int)
- func (qb *QueryBar) TextInput() *textinput.Model
- func (qb *QueryBar) UpdateCompletions(idx *index.Index)
- func (qb *QueryBar) Value() string
- func (qb *QueryBar) View() string
- type SavedView
- type StatusBar
- type Theme
Constants ¶
This section is empty.
Variables ¶
var ( StyleError lipgloss.Style StyleWarn lipgloss.Style StyleInfo lipgloss.Style StyleDebug lipgloss.Style StyleFatal lipgloss.Style StyleBorder lipgloss.Style StyleStatusBar lipgloss.Style StyleQueryBar lipgloss.Style StyleHighlight lipgloss.Style StyleDim lipgloss.Style StyleTitle lipgloss.Style StyleMatch lipgloss.Style StyleHistBar lipgloss.Style StyleHistError lipgloss.Style StyleHistLabel lipgloss.Style )
Style variables (referenced by other UI files).
var DarkTheme = Theme{ Red: lipgloss.Color("#FF5555"), Orange: lipgloss.Color("#FFB86C"), Cyan: lipgloss.Color("#8BE9FD"), Gray: lipgloss.Color("#6272A4"), Green: lipgloss.Color("#50FA7B"), Purple: lipgloss.Color("#BD93F9"), White: lipgloss.Color("#F8F8F2"), Bg: lipgloss.Color("#44475A"), DarkBg: lipgloss.Color("#282A36"), MatchBg: lipgloss.Color("#F1FA8C"), MatchFg: lipgloss.Color("#282A36"), }
DarkTheme is the default Dracula-inspired dark palette.
var LightTheme = Theme{ Red: lipgloss.Color("#D32F2F"), Orange: lipgloss.Color("#E65100"), Cyan: lipgloss.Color("#00838F"), Gray: lipgloss.Color("#757575"), Green: lipgloss.Color("#2E7D32"), Purple: lipgloss.Color("#7B1FA2"), White: lipgloss.Color("#212121"), Bg: lipgloss.Color("#E0E0E0"), DarkBg: lipgloss.Color("#FAFAFA"), MatchBg: lipgloss.Color("#FFF176"), MatchFg: lipgloss.Color("#212121"), FillBackground: true, }
LightTheme is a light palette with dark text on light backgrounds.
var StyleBase lipgloss.Style
StyleBase is the base style — empty for dark theme, has background for light. Use StyleBase.Copy() when creating inline styles in rendering code.
Functions ¶
func ApplyTheme ¶ added in v0.6.2
func ApplyTheme(t Theme)
ApplyTheme sets all package-level color and style variables from the given theme.
func LevelStyle ¶
LevelStyle returns the appropriate style for a log level.
func RenderAppBackground ¶ added in v0.6.2
RenderAppBackground pads content to fill the viewport when the theme requires it. For dark theme, returns content unchanged.
Types ¶
type Completer ¶ added in v0.6.0
type Completer struct {
// contains filtered or unexported fields
}
Completer manages inline auto-completion state for the query bar.
func (*Completer) Current ¶ added in v0.6.0
Current returns the full text of the current candidate, or "".
func (*Completer) GhostSuffix ¶ added in v0.6.0
GhostSuffix returns the dimmed text to append after the cursor.
func (*Completer) HasCandidates ¶ added in v0.6.0
HasCandidates returns true if there are active completions.
type DetailView ¶
type DetailView struct {
// contains filtered or unexported fields
}
DetailView renders a full-screen overlay showing all fields of a record.
func (*DetailView) EnterPickMode ¶ added in v0.9.0
func (d *DetailView) EnterPickMode(items []trace.IDField)
EnterPickMode shows a selection list of trace ID fields.
func (*DetailView) ExitPickMode ¶ added in v0.9.0
func (d *DetailView) ExitPickMode()
ExitPickMode returns to normal detail view.
func (*DetailView) IsTreeMode ¶ added in v1.1.0
func (d *DetailView) IsTreeMode() bool
IsTreeMode returns true if the detail view is showing a JSON tree.
func (*DetailView) PickDown ¶ added in v0.9.0
func (d *DetailView) PickDown()
PickDown moves the pick cursor down.
func (*DetailView) PickSelected ¶ added in v0.9.0
func (d *DetailView) PickSelected() trace.IDField
PickSelected returns the currently selected trace ID field.
func (*DetailView) PickUp ¶ added in v0.9.0
func (d *DetailView) PickUp()
PickUp moves the pick cursor up.
func (*DetailView) SelectedDotPath ¶ added in v1.1.0
func (d *DetailView) SelectedDotPath() string
SelectedDotPath returns the dot path of the currently selected tree line.
func (*DetailView) SetHighlights ¶ added in v0.6.0
func (d *DetailView) SetHighlights(h []HighlightTerm)
SetHighlights sets the terms to highlight in the detail view.
func (*DetailView) SetRecord ¶
func (d *DetailView) SetRecord(r *parser.Record)
SetRecord sets the record to display.
func (*DetailView) SetSize ¶
func (d *DetailView) SetSize(w, h int)
SetSize updates the overlay dimensions.
func (*DetailView) TreeCollapse ¶ added in v1.1.0
func (d *DetailView) TreeCollapse()
TreeCollapse collapses the selected node or moves cursor to parent.
func (*DetailView) TreeDown ¶ added in v1.1.0
func (d *DetailView) TreeDown()
TreeDown moves the tree cursor down.
func (*DetailView) TreeExpand ¶ added in v1.1.0
func (d *DetailView) TreeExpand()
TreeExpand expands the selected node.
func (*DetailView) TreeToggle ¶ added in v1.1.0
func (d *DetailView) TreeToggle()
TreeToggle toggles expand/collapse on the selected node.
func (*DetailView) TreeUp ¶ added in v1.1.0
func (d *DetailView) TreeUp()
TreeUp moves the tree cursor up.
type HighlightTerm ¶ added in v0.6.0
type HighlightTerm struct {
Text string // plain text (case-insensitive match)
Pattern *regexp.Regexp // compiled regex (for field~"pattern" queries)
Field string // if non-empty, only highlight within this field
}
HighlightTerm represents a search term to highlight in log output.
func ExtractHighlightTerms ¶ added in v0.6.0
func ExtractHighlightTerms(node *query.Node) []HighlightTerm
ExtractHighlightTerms walks the query AST and collects terms for highlighting.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram renders a vertical time-based bar chart.
func (*Histogram) ScrollDown ¶
func (h *Histogram) ScrollDown()
ScrollDown moves the histogram cursor down.
func (*Histogram) SelectedBucket ¶
func (h *Histogram) SelectedBucket() *index.HistogramBucket
SelectedBucket returns the currently focused bucket, or nil.
func (*Histogram) SetBuckets ¶
func (h *Histogram) SetBuckets(buckets []index.HistogramBucket)
SetBuckets updates the histogram data.
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
PageUp key.Binding
PageDown key.Binding
Home key.Binding
End key.Binding
Left key.Binding
Right key.Binding
Search key.Binding
Enter key.Binding
Escape key.Binding
Tab key.Binding
Quit key.Binding
Copy key.Binding
CopyPath key.Binding
Save key.Binding
Trace key.Binding
TraceClear key.Binding
Pattern key.Binding
BookmarkToggle key.Binding
BookmarkNext key.Binding
BookmarkFilter key.Binding
}
KeyMap defines all keybindings.
type LogView ¶
type LogView struct {
// contains filtered or unexported fields
}
LogView renders the scrollable log lines panel.
func (*LogView) SelectedRecordIndex ¶
SelectedRecordIndex returns the index of the currently selected record, or -1 if nothing is selected.
func (*LogView) SetBookmarks ¶ added in v1.0.0
SetBookmarks sets the bookmark map for gutter rendering.
func (*LogView) SetColumns ¶ added in v0.6.2
SetColumns sets the column names for table rendering mode.
func (*LogView) SetHighlights ¶ added in v0.6.0
func (lv *LogView) SetHighlights(h []HighlightTerm)
SetHighlights sets the terms to highlight in log output.
func (*LogView) SetResults ¶
SetResults updates the filtered results.
func (*LogView) SetTraceOrigin ¶ added in v0.9.0
SetTraceOrigin sets the record index that originated a trace filter. Pass -1 to clear.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main bubbletea model.
func (*Model) SetAliases ¶ added in v0.8.0
SetAliases sets the alias registry for query expansion and autocomplete.
func (*Model) SetColumns ¶ added in v0.6.2
SetColumns sets the column names for column mode display.
func (*Model) SetFollowReader ¶ added in v0.2.0
func (m *Model) SetFollowReader(fr *input.FollowReader)
SetFollowReader enables follow mode for tailing a file.
func (*Model) SetHistory ¶ added in v0.6.2
SetHistory loads persistent history entries and sets the history file path.
func (*Model) SetTraceFields ¶ added in v0.9.0
SetTraceFields sets the list of field names to use for trace ID detection.
func (*Model) SetViews ¶ added in v1.1.0
SetViews sets the saved views for quick switching with digit keys.
type PatternView ¶ added in v1.0.0
type PatternView struct {
// contains filtered or unexported fields
}
PatternView renders the cluster list in pattern mode.
func NewPatternView ¶ added in v1.0.0
func NewPatternView() PatternView
NewPatternView creates a new pattern view.
func (*PatternView) GoToEnd ¶ added in v1.0.0
func (pv *PatternView) GoToEnd()
GoToEnd jumps to the last cluster.
func (*PatternView) GoToStart ¶ added in v1.0.0
func (pv *PatternView) GoToStart()
GoToStart jumps to the first cluster.
func (*PatternView) ScrollDown ¶ added in v1.0.0
func (pv *PatternView) ScrollDown(n int)
ScrollDown moves the cursor down.
func (*PatternView) ScrollUp ¶ added in v1.0.0
func (pv *PatternView) ScrollUp(n int)
ScrollUp moves the cursor up.
func (*PatternView) SelectedCluster ¶ added in v1.0.0
func (pv *PatternView) SelectedCluster() *pattern.Cluster
SelectedCluster returns the cluster under the cursor, or nil.
func (*PatternView) SetClusters ¶ added in v1.0.0
func (pv *PatternView) SetClusters(clusters []pattern.Cluster, total int)
SetClusters updates the cluster data.
func (*PatternView) SetSize ¶ added in v1.0.0
func (pv *PatternView) SetSize(w, h int)
SetSize updates the viewport dimensions.
func (*PatternView) View ¶ added in v1.0.0
func (pv *PatternView) View() string
View renders the pattern view.
type QueryBar ¶
type QueryBar struct {
// contains filtered or unexported fields
}
QueryBar wraps a text input for filter queries with history and auto-complete.
func (*QueryBar) AcceptCompletion ¶ added in v0.6.0
AcceptCompletion applies the current completion candidate to the input. Returns true if a completion was applied.
func (*QueryBar) CycleCompletion ¶ added in v0.6.0
func (qb *QueryBar) CycleCompletion()
CycleCompletion advances to the next completion candidate without accepting.
func (*QueryBar) HistoryDown ¶ added in v0.3.0
HistoryDown loads the next history entry. Returns true if handled.
func (*QueryBar) HistoryUp ¶ added in v0.3.0
HistoryUp loads the previous history entry. Returns true if handled.
func (*QueryBar) PushHistory ¶ added in v0.3.0
PushHistory adds a query to the history (deduplicates consecutive entries).
func (*QueryBar) SetAliases ¶ added in v0.8.0
SetAliases sets the alias registry for autocomplete.
func (*QueryBar) SetHistory ¶ added in v0.6.2
SetHistory replaces the internal history slice (used for loading persistent history).
func (*QueryBar) UpdateCompletions ¶ added in v0.6.0
UpdateCompletions recomputes completion candidates based on the current input.
type StatusBar ¶
type StatusBar struct {
// contains filtered or unexported fields
}
StatusBar renders the bottom status line.
type Theme ¶ added in v0.6.2
type Theme struct {
Red lipgloss.Color
Orange lipgloss.Color
Cyan lipgloss.Color
Gray lipgloss.Color
Green lipgloss.Color
Purple lipgloss.Color
White lipgloss.Color
Bg lipgloss.Color
DarkBg lipgloss.Color
MatchBg lipgloss.Color
MatchFg lipgloss.Color
FillBackground bool // if true, paint the viewport with DarkBg
}
Theme holds all colors used throughout the UI.
func DetectTheme ¶ added in v0.6.2
func DetectTheme() Theme
DetectTheme returns LightTheme or DarkTheme based on the terminal background.