app

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModel

func NewModel(
	fileName string,
	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 {
	FileName string
	Config   *config.Config

	BaseStyle   lipgloss.Style
	FooterStyle lipgloss.Style

	LastWindowSize tea.WindowSizeMsg
	Entries        source.LazyLogEntries
	Version        string
	// contains filtered or unexported fields
}

Application global state.

func (*Application) Update added in v1.0.0

func (app *Application) Update(msg tea.Msg)

Update application state.

type EntriesUpdateMsg added in v1.0.0

type EntriesUpdateMsg struct {
	Entries rowGetter
}

type KeyMap added in v0.2.2

type KeyMap struct {
	Exit            key.Binding
	Back            key.Binding
	Open            key.Binding
	ToggleViewArrow key.Binding
	Up              key.Binding
	Reverse         key.Binding
	Down            key.Binding
	Filter          key.Binding
	ToggleFullHelp  key.Binding
	GotoTop         key.Binding
	GotoBottom      key.Binding
	ShowPreview     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 {
	*Application
	// 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) 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 {
	*Application
	// 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) 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 {
	*Application
	// 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) 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 {
	*Application
}

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) 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 {
	*Application
	// contains filtered or unexported fields
}

StateLoadedModel is a state that shows all loaded records.

func (StateLoadedModel) Init added in v0.4.0

func (s StateLoadedModel) Init() tea.Cmd

Init initializes component. It implements tea.Model.

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 {
	*Application
	// 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) 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