package logview

import "github.com/amonks/run/logview"

Logview is a [bubbletea.Model] optimized for displaying logs.

Index

Functions

func WithHardWrap

func WithHardWrap(m *Model)

func WithStartAtHead

func WithStartAtHead(m *Model)

func WithoutStatusbar

func WithoutStatusbar(m *Model)

Types

type FocusArea

type FocusArea int
const (
	FocusSearchBar FocusArea
	FocusLogPane
	FocusHelp
)

type Model

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

func New

func New(mods ...func(*Model)) *Model

func (*Model) Focus

func (m *Model) Focus() FocusArea

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) MoveResultIndex

func (m *Model) MoveResultIndex(by int)

func (*Model) Query

func (m *Model) Query() string

func (*Model) Render

func (m *Model) Render(styles *Styles, width, height int) string

func (*Model) RenderLineStatus

func (m *Model) RenderLineStatus() string

func (*Model) RenderLog

func (m *Model) RenderLog(width, height int) string

func (*Model) RenderSearchStatus

func (m *Model) RenderSearchStatus() string

func (*Model) ResultIndex

func (m *Model) ResultIndex() int

func (*Model) Results

func (m *Model) Results() []searchResult

func (*Model) ScrollBy

func (m *Model) ScrollBy(lines int)

func (*Model) ScrollTo

func (m *Model) ScrollTo(line int)

func (*Model) SetDimensions

func (m *Model) SetDimensions(width, height int)

func (*Model) SetFocus

func (m *Model) SetFocus(focus FocusArea)

func (*Model) SetQuery

func (m *Model) SetQuery(query string)

func (*Model) SetResultIndex

func (m *Model) SetResultIndex(index int)

func (*Model) SetWrapMode

func (m *Model) SetWrapMode(hardwrap bool)

func (*Model) ShowStatusbar

func (m *Model) ShowStatusbar(show bool)

func (*Model) String

func (m *Model) String() string

func (*Model) ToggleWrapMode

func (m *Model) ToggleWrapMode()

func (*Model) Update

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

func (*Model) View

func (m *Model) View() tea.View

func (*Model) ViewString

func (m *Model) ViewString() string

func (*Model) Write

func (m *Model) Write(content string)

type Styles

type Styles struct {
	Log       lipgloss.Style
	Statusbar lipgloss.Style
}