tui

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: BSD-2-Clause, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, apiClient apiclient.APIClient) error

Run starts the TUI application

func RunTUI

func RunTUI(ctx context.Context, socketPath string) error

RunTUI starts the TUI with the provided socket path

Types

type APIClient

type APIClient = apiclient.APIClient

APIClient is aliased from apiclient.APIClient

type LogEntry added in v0.0.15

type LogEntry struct {
	Time     time.Time
	Level    string
	Message  string
	Attrs    map[string]any
	AttrJSON string // cached JSON string for Attrs (filtered)
}

LogEntry represents a log message

type ProbeLogEntry added in v0.0.9

type ProbeLogEntry = types.ProbeLogEntry

Use types.ProbeLogEntry instead of local definition

type TUIHandler added in v0.0.15

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

TUIHandler is a custom slog.Handler that sends logs to the TUI

func NewTUIHandler added in v0.0.15

func NewTUIHandler(logChan chan<- LogEntry, next slog.Handler) *TUIHandler

NewTUIHandler creates a new TUI handler that sends logs to the given channel and also forwards to the next handler (for console output)

func (*TUIHandler) Enabled added in v0.0.15

func (h *TUIHandler) Enabled(ctx context.Context, level slog.Level) bool

Enabled reports whether the handler handles records at the given level

func (*TUIHandler) Handle added in v0.0.15

func (h *TUIHandler) Handle(ctx context.Context, r slog.Record) error

Handle handles the Record

func (*TUIHandler) WithAttrs added in v0.0.15

func (h *TUIHandler) WithAttrs(attrs []slog.Attr) slog.Handler

WithAttrs returns a new Handler whose attributes consist of both the receiver's attributes and the arguments

func (*TUIHandler) WithGroup added in v0.0.15

func (h *TUIHandler) WithGroup(name string) slog.Handler

WithGroup returns a new Handler with the given group appended to the receiver's existing groups

type TUIModel

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

TUIModel represents the TUI application state

func NewModel

func NewModel(ctx context.Context, apiClient apiclient.APIClient) *TUIModel

NewModel creates a new TUI model

func (*TUIModel) GetLogChannel added in v0.0.15

func (m *TUIModel) GetLogChannel() chan<- LogEntry

GetLogChannel returns the log channel for external log writers

func (*TUIModel) Init

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

Init initializes the TUI model

func (*TUIModel) Update

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

Update handles TUI messages and state updates

func (*TUIModel) View

func (m *TUIModel) View() string

View renders the current TUI state

type ViewMode

type ViewMode int

ViewMode represents the current view state

const (
	ViewList ViewMode = iota
	ViewDetail
	ViewConfirm
	ViewProbe
	ViewServerLogs
	ViewSaveConfirm
)

Jump to

Keyboard shortcuts

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