MCPcopy
hub / github.com/pterm/pterm / SpinnerPrinter

Struct SpinnerPrinter

spinner_printer.go:32–53  ·  view source on GitHub ↗

SpinnerPrinter is a loading animation, which can be used if the progress is unknown. It's an animation loop, which can have a text and supports throwing errors or warnings. A TextPrinter is used to display all outputs, after the SpinnerPrinter is done.

Source from the content-addressed store, hash-verified

30// It's an animation loop, which can have a text and supports throwing errors or warnings.
31// A TextPrinter is used to display all outputs, after the SpinnerPrinter is done.
32type SpinnerPrinter struct {
33 Text string
34 Sequence []string
35 Style *Style
36 Delay time.Duration
37 MessageStyle *Style
38 InfoPrinter TextPrinter
39 SuccessPrinter TextPrinter
40 FailPrinter TextPrinter
41 WarningPrinter TextPrinter
42 RemoveWhenDone bool
43 ShowTimer bool
44 TimerRoundingFactor time.Duration
45 TimerStyle *Style
46
47 IsActive bool
48
49 startedAt time.Time
50 currentSequence string
51
52 Writer io.Writer
53}
54
55// WithText adds a text to the SpinnerPrinter.
56func (s SpinnerPrinter) WithText(text string) *SpinnerPrinter {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected