Documentation ¶
Index ¶
Constants ¶
View Source
const ( ColorNone = -1 ColorBlack = Color(color.FgBlack) ColorRed = Color(color.FgRed) ColorGreen = Color(color.FgGreen) ColorYellow = Color(color.FgYellow) ColorBlue = Color(color.FgBlue) ColorMagenta = Color(color.FgMagenta) ColorCyan = Color(color.FgCyan) ColorWhite = Color(color.FgWhite) )
Variables ¶
View Source
var SpriteFrames = map[int][]string{
0: {"←", "↖", "↑", "↗", "→", "↘", "↓", "↙"},
1: {"←", "↑", "→", "↓"},
2: {"⇐", "⇖", "⇑", "⇗", "⇒", "⇘", "⇓", "⇙"},
3: {"◢", "◣", "◤", "◥"},
4: {"◰", "◳", "◲", "◱"},
5: {"◴", "◷", "◶", "◵"},
6: {"◐", "◓", "◑", "◒"},
7: {"⬒", "⬔", "⬓", "⬕"},
8: {"⬖", "⬘", "⬗", "⬙"},
9: {"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"},
10: {"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"},
}
SpriteFrames are a premade sets of sprite frames.
Functions ¶
This section is empty.
Types ¶
type Spinner ¶
type Spinner struct { RefreshInterval time.Duration LastFrame string // contains filtered or unexported fields }
Spinner is an infinite ui spinner with status text
func New ¶
New creates a new Spinner with the given sprite. If sprite nil, a defualt sprite will be used.
func (*Spinner) Start ¶
func (s *Spinner) Start(f func())
Start starts the spinner while executing the provided function. This functions blocks until the end of the supplied function. The rendering of the spinner + text is done on a different goroutine. The user function will be executed on the main thread.
Click to show internal directories.
Click to hide internal directories.