Documentation ¶
Overview ¶
Package spinner is a simple implementation of a text-based 'spinner' UI widget, for use when programs need to indicate they are busy. It takes inspiration from Brian Down's spinner implementation (the erase() method in particular, and embedding an io.Writer for testing), and the simple spinner implementation in 'The Go Programming Lanuguage'
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner holds all the required options for the spinner instance; users can supply a prefix if required (otherwise the spinner will just display as-is) and io.Writer.
func New ¶
func New(opts ...option) *Spinner
New returns an initialised Spinner structure; callers will need to supply a prefix to the spinner if required.
The default behaviour outputs to stdout; this can be overridden by passing in the Writer() config option with an appropriate implementation of io.Writer.