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.
| 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. |
| 32 | type 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. |
| 56 | func (s SpinnerPrinter) WithText(text string) *SpinnerPrinter { |
nothing calls this directly
no outgoing calls
no test coverage detected