Documentation
¶
Overview ¶
Package ui renders the live terminal dashboard. It owns a flat view-model (Row/Event) so it never depends on the orchestrator's result/options types; the caller adapts its events into ui.Event. Everything here is presentation: the renderers are pure string functions over Row, and Renderer is the only piece that touches the terminal.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyEvent ¶
ApplyEvent folds an event into a row's display state.
func MethodLabel ¶
MethodLabel maps an update method kind to its short display label.
Types ¶
type Event ¶
type Event struct {
Index int
Phase string
Status string
Reason string
Method string
Before string
After string
Duration time.Duration
Time time.Time
Show bool
}
Event is a flat update-lifecycle event the dashboard consumes. The caller adapts its richer event type into this view-model.
type Renderer ¶
type Renderer struct {
Out *os.File
UseColor bool
UseUnicode bool
Width int
// contains filtered or unexported fields
}
Renderer draws frames to a terminal, tracking how many lines the last frame occupied so it can redraw in place.
func NewRenderer ¶
NewRenderer builds a Renderer with capabilities detected from the environment.
func (*Renderer) HideCursor ¶ added in v0.8.0
func (r *Renderer) HideCursor()
HideCursor hides the terminal cursor for the duration of a live render.
func (*Renderer) RenderFrame ¶
func (r *Renderer) RenderFrame(rows []Row, nameWidth int, start time.Time, explain bool, detected, total int) string
RenderFrame builds one dashboard frame: a boot line until the first visible row is detected, then the full dashboard.
func (*Renderer) ShowCursor ¶ added in v0.8.0
func (r *Renderer) ShowCursor()
ShowCursor restores the terminal cursor after a live render.