Documentation
¶
Index ¶
- type LogLineMsg
- type Model
- func (m *Model) Clear()
- func (m *Model) GetScrollInfo() (currentLine, totalLines int)
- func (m *Model) GetScrollPercent() float64
- func (m *Model) GotoBottom()
- func (m *Model) GotoTop()
- func (m Model) Init() tea.Cmd
- func (m Model) IsFollowing() bool
- func (m *Model) SetContent(content string)
- func (m *Model) Start(files map[string]string) tea.Cmd
- func (m *Model) Stop()
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- type StreamWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogLineMsg ¶
type LogLineMsg struct {
Workspace string
Line string
NoPrefix bool // If true, formatLogLine will not add a workspace prefix
}
LogLineMsg is sent when a new log line is received.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the TUI component for viewing logs.
func (*Model) GetScrollInfo ¶
GetScrollInfo returns current scroll position information.
func (*Model) GetScrollPercent ¶
GetScrollPercent returns the scroll position as a percentage.
func (*Model) GotoBottom ¶
func (m *Model) GotoBottom()
GotoBottom scrolls to the bottom of the log content.
func (Model) IsFollowing ¶
IsFollowing returns whether the log viewer is in follow mode.
func (*Model) SetContent ¶
SetContent displays static content, stopping any live tailing.
type StreamWriter ¶
type StreamWriter struct {
NoWorkspacePrefix bool // If true, LogLineMsg will have NoPrefix set
// contains filtered or unexported fields
}
StreamWriter implements io.Writer and sends complete log lines as messages to a TUI program. It buffers partial lines until a newline is encountered, ensuring that log lines are not split in the middle when streaming output.
func NewStreamWriter ¶
func NewStreamWriter(program *tea.Program, workspace string) *StreamWriter
NewStreamWriter creates a new StreamWriter that sends log lines to the given TUI program. The workspace parameter is used to tag log lines with their source.