ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCelHighlight

func ApplyCelHighlight(e log.Entry, expr string, compiled *filter.CompiledFilter, colorIndex int) map[string]lipgloss.Color

ApplyCelHighlight returns a highlight color map for fields matching a CEL expression. Only highlights fields that are referenced in the expression.

func FormatLine

func FormatLine(line string, logFormat log.Format) string

FormatLine formats a single log line for plain output.

func FormatLineWithHighlight

func FormatLineWithHighlight(e log.Entry, expr string, highlight *filter.CompiledFilter) string

FormatLineWithHighlight formats a log entry with optional CEL-based highlighting.

Types

type CelFilter

type CelFilter struct {
	Expression string
	Compiled   *filter.CompiledFilter
	Enabled    bool
}

CelFilter represents a CEL expression-based filter.

type CelHighlight

type CelHighlight struct {
	Expression string
	Compiled   *filter.CompiledFilter
	ColorIndex int
	Enabled    bool
}

CelHighlight represents a CEL expression-based highlight.

type CelInput

type CelInput struct {
	// contains filtered or unexported fields
}

CelInput is a reusable component for entering CEL expressions. It provides a field picker followed by text input with tab completion.

func NewCelInput

func NewCelInput(fields []string, placeholders []string) CelInput

NewCelInput creates a new CEL input component.

func (CelInput) Error

func (c CelInput) Error() string

Error returns the current error message.

func (CelInput) Phase

func (c CelInput) Phase() CelInputPhase

Phase returns the current phase.

func (*CelInput) ResetToInput

func (c *CelInput) ResetToInput()

ResetToInput resets to input phase (for retrying after error).

func (*CelInput) SetError

func (c *CelInput) SetError(err string)

SetError sets an error message to display.

func (*CelInput) SetInitialValue

func (c *CelInput) SetInitialValue(value string)

SetInitialValue sets an initial value and skips the picker phase.

func (CelInput) Update

func (c CelInput) Update(msg tea.KeyMsg) (CelInput, tea.Cmd)

Update handles input messages and returns the updated component and any command.

func (CelInput) Value

func (c CelInput) Value() string

Value returns the entered expression (only valid when phase is CelPhaseDone).

func (CelInput) ViewHint

func (c CelInput) ViewHint() string

ViewHint renders the CEL methods hint line.

func (CelInput) ViewInput

func (c CelInput) ViewInput() string

ViewInput renders the text input.

func (CelInput) ViewPicker

func (c CelInput) ViewPicker() string

ViewPicker renders the field picker.

type CelInputPhase

type CelInputPhase int

CelInputPhase represents the current phase of CEL input.

const (
	CelPhasePicker CelInputPhase = iota
	CelPhaseInput
	CelPhaseDone
	CelPhaseCancelled
)

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model represents the application state.

func New

func New(lineChan <-chan string, format log.Format) Model

New creates a new Model with in-memory storage and a channel for new lines.

func NewWithStore

func NewWithStore(s *store.Store, lineChan <-chan string) Model

NewWithStore creates a new Model with a disk-backed store.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model.

func (Model) KnownFields

func (m Model) KnownFields() []string

KnownFields returns all unique field names seen in the log entries.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages.

func (Model) View

func (m Model) View() string

View renders the UI.

Jump to

Keyboard shortcuts

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