Documentation
¶
Overview ¶
Package spinner implements a means of rendering unicode characters that give a sense that something is happening and that the user is waiting during that process.
The Spinner constructed does not actually write or otherwise output anything in particular. Instead, it simply provides the current unicode character for that moment or iteration depending on whether Spinner.Start was called or if the Spinner.Increment method is used to step to the next logical character in the loop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DefaultSpinnerRunes, _ = paint.GetSpinners(paint.SevenDotSpinner)
DefaultSymbols = DefaultSpinnerRunes.Strings()
)
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(symbol string)
Callback is the function signature for the `fn` argument to New
type Spinner ¶
type Spinner interface { // String returns the current symbol String() (symbol string) // Increment moves the spinner to the symbol Increment() // Start simply calls StartWith an interval of 250ms Start() // StartWith (and Start) are blocking operations, use a goroutine // to start a spinner in the background. If using within a Go-Curses // environment, use cdk.Go to invoke the goroutine. Once started, // a time.Ticker is used to call the New `fn` (if not nil) and // increment the spinner state once every interval StartWith(interval time.Duration) // Stop stops any started incrementing Stop() }
Spinner is the interface for interacting with the New Spinner instance, all methods are concurrency safe