Documentation ¶
Overview ¶
Package spinner is a simple package to add a spinner/progress indicator to your application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CharSets = [][]string{
{"←", "↖", "↑", "↗", "→", "↘", "↓", "↙"},
{"▁", "▃", "▄", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▄", "▃", "▁"},
{"▖", "▘", "▝", "▗"},
{"┤", "┘", "┴", "└", "├", "┌", "┬", "┐"},
{"◢", "◣", "◤", "◥"},
{"◰", "◳", "◲", "◱"},
{"◴", "◷", "◶", "◵"},
{"◐", "◓", "◑", "◒"},
{".", "o", "O", "@", "*"},
{"|", "/", "-", "\\"},
{"◡◡", "⊙⊙", "◠◠"},
{"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"},
{">))'>", " >))'>", " >))'>", " >))'>", " >))'>", " <'((<", " <'((<", " <'((<"},
{"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"},
{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"},
{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"},
{"▉", "▊", "▋", "▌", "▍", "▎", "▏", "▎", "▍", "▌", "▋", "▊", "▉"},
{"■", "□", "▪", "▫"},
{"←", "↑", "→", "↓"},
{"╫", "╪"},
{"⇐", "⇖", "⇑", "⇗", "⇒", "⇘", "⇓", "⇙"},
{"⠁", "⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈", "⠈"},
{"⠈", "⠉", "⠋", "⠓", "⠒", "⠐", "⠐", "⠒", "⠖", "⠦", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈"},
{"⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠴", "⠲", "⠒", "⠂", "⠂", "⠒", "⠚", "⠙", "⠉", "⠁"},
{"⠋", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋"},
{"ヲ", "ァ", "ィ", "ゥ", "ェ", "ォ", "ャ", "ュ", "ョ", "ッ", "ア", "イ", "ウ", "エ", "オ", "カ", "キ", "ク", "ケ", "コ", "サ", "シ", "ス", "セ", "ソ", "タ", "チ", "ツ", "テ", "ト", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "ヒ", "フ", "ヘ", "ホ", "マ", "ミ", "ム", "メ", "モ", "ヤ", "ユ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ワ", "ン"},
{".", "..", "..."},
{"▁", "▂", "▃", "▄", "▅", "▆", "▇", "█", "▉", "▊", "▋", "▌", "▍", "▎", "▏", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█", "▇", "▆", "▅", "▄", "▃", "▂", "▁"},
{".", "o", "O", "°", "O", "o", "."},
{"+", "x"},
{"v", "<", "^", ">"},
{">>--->", " >>--->", " >>--->", " >>--->", " >>--->", " <---<<", " <---<<", " <---<<", " <---<<", "<---<<"},
{"|", "||", "|||", "||||", "|||||", "|||||||", "||||||||", "|||||||", "||||||", "|||||", "||||", "|||", "||", "|"},
{"[ ]", "[= ]", "[== ]", "[=== ]", "[==== ]", "[===== ]", "[====== ]", "[======= ]", "[======== ]", "[========= ]", "[==========]"},
{"(*---------)", "(-*--------)", "(--*-------)", "(---*------)", "(----*-----)", "(-----*----)", "(------*---)", "(-------*--)", "(--------*-)", "(---------*)"},
{"█▒▒▒▒▒▒▒▒▒", "███▒▒▒▒▒▒▒", "█████▒▒▒▒▒", "███████▒▒▒", "██████████"},
}
CharSets contains the available character sets
Functions ¶
func GenerateNumberSequence ¶
GenerateNumberSequence will generate a slice of integers at the provided length and convert them each to a string
Types ¶
type Spinner ¶
type Spinner struct { Delay time.Duration // speed of the spinner Prefix string // Text preppended to the spinner Suffix string // Text appended to the spinner ST state // spinner status // contains filtered or unexported fields }
Spinner struct to hold the provided options
func (*Spinner) Reverse ¶
func (s *Spinner) Reverse()
Reverse will reverse the order of the slice assigned to that spinner
func (*Spinner) UpdateCharSet ¶
UpdateCharSet will change the previously select character set to the provided one
func (*Spinner) UpdateSpeed ¶
UpdateSpeed is a convenience function to not have to make you create a new instance of the Spinner
Click to show internal directories.
Click to hide internal directories.