Documentation
¶
Overview ¶
Package tui is the Bubble Tea front-end for the fleet engine: a live "btop'ed out" run watcher, and an interactive console for setting up and launching runs.
Index ¶
- func RenderStatusBoard(machines []fleet.Machine, now time.Time) string
- func RunConsole() error
- func RunGather(plan fleet.Plan, opts fleet.Options, parse string, ...) error
- func RunStatusBoard(reg *fleet.Registry, registryPath string, tr fleet.Transport, ...) error
- func RunWatcher(plan fleet.Plan, opts fleet.Options, stage fleet.StageOptions, ...) error
- type Console
- type GatherView
- type StatusBoard
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderStatusBoard ¶ added in v0.4.0
RenderStatusBoard draws the live fleet-status dashboard for the given machines.
func RunConsole ¶
func RunConsole() error
RunConsole launches the interactive run builder (TUI #2). On launch it hands off to the live Watcher.
func RunGather ¶
func RunGather(plan fleet.Plan, opts fleet.Options, parse string, osByTarget map[string]string) error
RunGather runs the plan, parses the output per the parse hint, then shows it in the interactive spreadsheet. osByTarget (may be nil) injects an OS column.
func RunStatusBoard ¶ added in v0.4.0
func RunStatusBoard(reg *fleet.Registry, registryPath string, tr fleet.Transport, opts fleet.Options, svcName string, every time.Duration) error
RunStatusBoard launches the live fleet-status dashboard, polling the agent service on every registered machine every `every`.
func RunWatcher ¶
func RunWatcher(plan fleet.Plan, opts fleet.Options, stage fleet.StageOptions, life fleet.LifecycleOptions) error
RunWatcher launches the live dashboard (TUI #1) for an already-built plan.
Types ¶
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console is the interactive run builder. It speaks every verb the CLI does: pick a task, fill its fields, set transport + staging, then hand off to the live Watcher.
func NewConsole ¶
func NewConsole() Console
NewConsole builds the setup form. Verb-specific fields are hidden unless their task is selected, so the form only ever shows what's relevant.
type GatherView ¶
type GatherView struct {
// contains filtered or unexported fields
}
GatherView is the read side of the fleet in the TUI: a spreadsheet over the per-target output. It's "just data" — sort or group by any column (synthetic TARGET/EXIT/OS or whatever the query parses into), collapse groups into a tree, and type-to-filter. Keys: / filter · s/S sort col/dir · g group · space collapse · ↑↓ move · q/esc quit.
func (GatherView) Init ¶
func (g GatherView) Init() tea.Cmd
func (GatherView) View ¶
func (g GatherView) View() string
type StatusBoard ¶ added in v0.4.0
type StatusBoard struct {
// contains filtered or unexported fields
}
StatusBoard is the live heartbeat dashboard: it re-polls the agent service on every registered machine every `every`, flips row states/colors in place, and stamps the registry. The poll IS the engine's fan-out.
func NewStatusBoard ¶ added in v0.4.0
func NewStatusBoard(reg *fleet.Registry, registryPath string, tr fleet.Transport, opts fleet.Options, svcName string, every time.Duration) StatusBoard
NewStatusBoard builds the board for the registry's machines.
func (StatusBoard) Init ¶ added in v0.4.0
func (b StatusBoard) Init() tea.Cmd
func (StatusBoard) View ¶ added in v0.4.0
func (b StatusBoard) View() string
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is the live dashboard for a single run. It drives fleet.Run in a goroutine and renders progress as start/result events stream in.
func NewWatcher ¶
func NewWatcher(plan fleet.Plan, opts fleet.Options, stage fleet.StageOptions, life fleet.LifecycleOptions) Watcher
NewWatcher builds a watcher for a plan. The caller provides the plan and options; the watcher installs its own OnStart/OnResult hooks.