app

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModel

func NewModel(
	sourceInput source.Input,
	config *config.Config,
	version string,
) tea.Model

NewModel initializes a new application model. It accept the path to the file with logs.

Types

type Application added in v0.2.0

type Application struct {
	SourceInput source.Input
	Config      *config.Config

	BaseStyle   lipgloss.Style
	FooterStyle lipgloss.Style

	LastWindowSize tea.WindowSizeMsg

	Version string
}

Application global state.

type KeyMap added in v0.2.2

type KeyMap struct {
	Exit            key.Binding
	Back            key.Binding
	ToggleView      key.Binding
	ToggleViewArrow key.Binding
	Up              key.Binding
	Down            key.Binding
	Filter          key.Binding
}

func (KeyMap) FullHelp added in v0.2.2

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp added in v0.2.2

func (k KeyMap) ShortHelp() []key.Binding

type StateErrorModel added in v0.4.0

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

StateErrorModel is a failure message state.

func (StateErrorModel) Init added in v0.4.0

func (s StateErrorModel) Init() tea.Cmd

Init initializes component. It implements tea.Model.

func (StateErrorModel) LoadEntries added in v0.4.0

func (h StateErrorModel) LoadEntries() tea.Msg

LoadEntries reads and parses entries from the input source.

func (StateErrorModel) String added in v0.4.0

func (s StateErrorModel) String() string

String implements fmt.Stringer.

func (StateErrorModel) Update added in v0.4.0

func (s StateErrorModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles events. It implements tea.Model.

func (StateErrorModel) View added in v0.4.0

func (s StateErrorModel) View() string

View renders component. It implements tea.Model.

type StateFilteredModel added in v0.4.0

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

StateFilteredModel is a state that shows filtered records.

func (StateFilteredModel) Init added in v0.4.0

func (s StateFilteredModel) Init() tea.Cmd

Init initializes component. It implements tea.Model.

func (StateFilteredModel) LoadEntries added in v0.4.0

func (h StateFilteredModel) LoadEntries() tea.Msg

LoadEntries reads and parses entries from the input source.

func (StateFilteredModel) String added in v0.4.0

func (s StateFilteredModel) String() string

String implements fmt.Stringer.

func (StateFilteredModel) Update added in v0.4.0

func (s StateFilteredModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles events. It implements tea.Model.

func (StateFilteredModel) View added in v0.4.0

func (s StateFilteredModel) View() string

View renders component. It implements tea.Model.

type StateFilteringModel added in v0.4.0

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

StateFilteringModel is a state to prompt for filter term.

func (StateFilteringModel) Init added in v0.4.0

func (s StateFilteringModel) Init() tea.Cmd

Init initializes component. It implements tea.Model.

func (StateFilteringModel) LoadEntries added in v0.4.0

func (h StateFilteringModel) LoadEntries() tea.Msg

LoadEntries reads and parses entries from the input source.

func (StateFilteringModel) String added in v0.4.0

func (s StateFilteringModel) String() string

String implements fmt.Stringer.

func (StateFilteringModel) Update added in v0.4.0

func (s StateFilteringModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles events. It implements tea.Model.

func (StateFilteringModel) View added in v0.4.0

func (s StateFilteringModel) View() string

View renders component. It implements tea.Model.

type StateInitialModel added in v0.4.0

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

StateInitialModel is an initial loading state.

func (StateInitialModel) Init added in v0.4.0

func (s StateInitialModel) Init() tea.Cmd

Init initializes component. It implements tea.Model.

func (StateInitialModel) LoadEntries added in v0.4.0

func (h StateInitialModel) LoadEntries() tea.Msg

LoadEntries reads and parses entries from the input source.

func (StateInitialModel) String added in v0.4.0

func (s StateInitialModel) String() string

String implements fmt.Stringer.

func (StateInitialModel) Update added in v0.4.0

func (s StateInitialModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles events. It implements tea.Model.

func (StateInitialModel) View added in v0.4.0

func (s StateInitialModel) View() string

View renders component. It implements tea.Model.

type StateLoadedModel added in v0.4.0

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

StateLoadedModel is a state that shows all loaded records.

func (StateLoadedModel) Application added in v0.4.0

func (s StateLoadedModel) Application() Application

func (StateLoadedModel) Init added in v0.4.0

func (s StateLoadedModel) Init() tea.Cmd

Init initializes component. It implements tea.Model.

func (StateLoadedModel) LoadEntries added in v0.4.0

func (h StateLoadedModel) LoadEntries() tea.Msg

LoadEntries reads and parses entries from the input source.

func (StateLoadedModel) String added in v0.4.0

func (s StateLoadedModel) String() string

String implements fmt.Stringer.

func (StateLoadedModel) Update added in v0.4.0

func (s StateLoadedModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles events. It implements tea.Model.

nolint: cyclop // Many events in switch case.

func (StateLoadedModel) View added in v0.4.0

func (s StateLoadedModel) View() string

View renders component. It implements tea.Model.

type StateViewRowModel added in v0.4.0

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

StateViewRowModel is a state that shows extended JSON view.

func (StateViewRowModel) Init added in v0.4.0

func (s StateViewRowModel) Init() tea.Cmd

Init initializes component. It implements tea.Model.

func (StateViewRowModel) LoadEntries added in v0.4.0

func (h StateViewRowModel) LoadEntries() tea.Msg

LoadEntries reads and parses entries from the input source.

func (StateViewRowModel) String added in v0.4.0

func (s StateViewRowModel) String() string

String implements fmt.Stringer.

func (StateViewRowModel) Update added in v0.4.0

func (s StateViewRowModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles events. It implements tea.Model.

func (StateViewRowModel) View added in v0.4.0

func (s StateViewRowModel) View() string

View renders component. It implements tea.Model.

Jump to

Keyboard shortcuts

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