Documentation
¶
Overview ¶
Package progress renders deploy/delete step status as compact per-step lines instead of free-form prints.
The default reporter writes 'plain text with N/M counters' — no spinner library dep. When stdout is a TTY, in-progress lines are over-written via \r so the final state replaces the polling chatter. When stdout is not a TTY (CI, pipe, file), every state change appends a new line so the log is grep-able.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reporter ¶
type Reporter interface {
Start(label string) Step
// StartConcurrent opens a set of steps that run and render together.
// On a TTY they occupy a contiguous block of lines repainted in place
// as each one changes — so several long-running operations (e.g. the
// LookupService and SessionManager installs, which the operator
// reconciles at the same time) animate side by side rather than one
// appearing to finish before the other starts. On a non-TTY every
// state change of every step appends its own line so the log stays
// grep-able. The returned steps are safe to drive from separate
// goroutines; the group serialises rendering internally. The caller
// must close every returned step (Done or Fail).
StartConcurrent(labels ...string) []Step
// Note prints a one-off informational line outside the step counter
// (used for things like 'syncing cached local secrets'). It does
// not advance the step counter.
Note(msg string)
}
Reporter is the surface deploy.go / delete.go talk to. Each call to Start opens a Step the caller closes via Done or Fail. Update can be called any number of times in between to surface intermediate phase changes (the wait poller drives this).
Reporters are safe for use from a single goroutine. The CLI today runs deploy strictly sequentially so a mutex-protected concurrency story isn't needed.
func New ¶
New builds the default reporter. total is the expected step count (drives the N/M counter); 0 means counters are hidden ("delete" has a variable step count depending on what's actually present, so it passes 0 and just gets prefix-less lines).
w is the destination; isTTY determines whether \r-based overwrite is used. Callers in cmd/ wire isTTY from os.Stdout.
func NewForStdout ¶
NewForStdout wires the default reporter against os.Stdout and auto-detects TTY. Used by cmd/ to avoid threading isatty through every option struct.