Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run shows a spinner labeled msg while fn runs, then stops it — the convenience wrapper over Start/Complete for a blocking op that otherwise prints nothing (Docker build, cluster bring-up). fn gets a context that is cancelled if the user interrupts (Ctrl-C); on that cancellation Run returns a silent error so the terminal isn't flooded with a stack trace.
Types ¶
type Options ¶
type Options struct {
// Elapsed enables a "(Ns)" suffix that ticks once per Bubble Tea frame.
// Use for silent long-running ops (cluster bring-up, image import) where
// users would otherwise wonder if the process is hung.
Elapsed bool
}
Options controls optional spinner behavior. Zero value is the legacy "spinner + text, no elapsed counter" mode used by the rest of the CLI.
type Session ¶
type Session interface {
Update(text string)
Complete()
Quit()
}
Session represents a running spinner session. Update changes the displayed text. Complete stops the spinner. Quit is an alias for Complete.
type Spinner ¶
type Spinner struct {
Spinner spinner.Model
Cancel func()
// Started is the moment the spinner began; used to render an elapsed
// counter "(Ns)" when ShowElapsed is true. Bubble Tea re-renders on
// every Spinner.Tick (~100ms) so the counter updates without us
// scheduling our own ticks.
Started time.Time
ShowElapsed bool
// contains filtered or unexported fields
}
Spinner is a component that displays a spinner while updating the logs.