Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecWithSpinner ¶
ExecWithSpinner runs an operation with a spinner UI. ProgressMsg is shown while operation is running (e.g., "Starting container"). CompletedMsg is shown when operation completes successfully (e.g., "Started container").
func ExecWithSpinnerDynamic ¶ added in v1.203.0
ExecWithSpinnerDynamic runs an operation with a spinner UI where the completion message is determined dynamically by the operation. The operation returns both the completion message and any error. This is useful when the completion message depends on the result of the operation (e.g., displaying refs that were compared).
Types ¶
type Spinner ¶ added in v1.203.0
type Spinner struct {
// contains filtered or unexported fields
}
Spinner provides a start/stop API for long-running operations where multiple sequential steps need to run while the spinner is displayed. For single operations, prefer ExecWithSpinner or ExecWithSpinnerDynamic instead.
Example usage:
s := spinner.New("Processing...")
s.Start()
defer s.Stop()
// Do multiple operations while spinner runs...
step1()
step2()
s.Success("Processing complete")
func (*Spinner) Error ¶ added in v1.203.0
Error stops the spinner and displays an error message with xmark. Error is idempotent and safe to call multiple times.
func (*Spinner) Start ¶ added in v1.203.0
func (s *Spinner) Start()
Start begins displaying the spinner. Call Stop() when done.