Documentation ยถ
Overview ยถ
Package spinner is a simple package to add a spinner / progress indicator to any terminal application.
Index ยถ
- Variables
- func GenerateNumberSequence(length int) []string
- type Options
- type Spinner
- func (s *Spinner) Color(colors ...string) error
- func (s *Spinner) Fail(text string)
- func (s *Spinner) Info(text string)
- func (s *Spinner) Lock()
- func (s *Spinner) Restart()
- func (s *Spinner) Reverse()
- func (s *Spinner) Start()
- func (s *Spinner) Stop()
- func (s *Spinner) StopAndPersist(symbol string, text string)
- func (s *Spinner) Succeed(text string)
- func (s *Spinner) Unicorn(text string)
- func (s *Spinner) Unlock()
- func (s *Spinner) UpdateCharSet(cs []string)
- func (s *Spinner) UpdateSpeed(d time.Duration)
Constants ยถ
This section is empty.
Variables ยถ
var CharSets = map[string][]string{
"dots": {
"โ ",
"โ ",
"โ น",
"โ ธ",
"โ ผ",
"โ ด",
"โ ฆ",
"โ ง",
"โ ",
"โ ",
},
"dots2": {
"โฃพ",
"โฃฝ",
"โฃป",
"โขฟ",
"โกฟ",
"โฃ",
"โฃฏ",
"โฃท",
},
"dots3": {
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ฆ",
"โ ด",
"โ ฒ",
"โ ณ",
"โ ",
},
"dots4": {
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ธ",
"โ ฐ",
"โ ",
"โ ฐ",
"โ ธ",
"โ ",
"โ ",
"โ ",
"โ ",
},
"dots5": {
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ฒ",
"โ ด",
"โ ฆ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
},
"dots6": {
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ฒ",
"โ ด",
"โ ค",
"โ ",
"โ ",
"โ ค",
"โ ด",
"โ ฒ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
},
"dots7": {
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ฆ",
"โ ค",
"โ ",
"โ ",
"โ ค",
"โ ฆ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
},
"dots8": {
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ฒ",
"โ ด",
"โ ค",
"โ ",
"โ ",
"โ ค",
"โ ",
"โ ",
"โ ค",
"โ ฆ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
},
"dots9": {
"โขน",
"โขบ",
"โขผ",
"โฃธ",
"โฃ",
"โกง",
"โก",
"โก",
},
"dots10": {
"โข",
"โข",
"โข",
"โก",
"โก",
"โก",
"โก ",
},
"dots11": {
"โ ",
"โ ",
"โ ",
"โก",
"โข",
"โ ",
"โ ",
"โ ",
},
"dots12": {
"โขโ ",
"โกโ ",
"โ โ ",
"โขโ ",
"โกโ ",
"โ
โ ",
"โขโ ",
"โกโ ",
"โ โ ",
"โขโ ",
"โกโ ",
"โ โ ",
"โขโ ",
"โกโ ",
"โ โ ",
"โ โ ",
"โ โ ",
"โ โ ",
"โ โ ",
"โ โ ฉ",
"โ โข",
"โ โก",
"โขโ ฉ",
"โกโข",
"โ โก",
"โขโ ฉ",
"โกโข",
"โ
โก",
"โขโ จ",
"โกโข",
"โ โก",
"โขโ ",
"โกโข",
"โ โก",
"โขโ ",
"โกโ ",
"โ โ ",
"โ โ ",
"โ โ ",
"โ โ ",
"โ โ ",
"โ โ ฉ",
"โ โข",
"โ โก",
"โ โ ฉ",
"โ โข",
"โ โก",
"โ โ ฉ",
"โ โข",
"โ โก",
"โ โ จ",
"โ โข",
"โ โก",
"โ โ ",
"โ โข",
"โ โก",
},
"dots8Bit": {
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ
",
"โ ",
"โ ",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก
",
"โก",
"โก",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โ ",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โก",
"โ ",
"โ ก",
"โ ข",
"โ ฃ",
"โ ค",
"โ ฅ",
"โ ฆ",
"โ ง",
"โก ",
"โกก",
"โกข",
"โกฃ",
"โกค",
"โกฅ",
"โกฆ",
"โกง",
"โ จ",
"โ ฉ",
"โ ช",
"โ ซ",
"โ ฌ",
"โ ญ",
"โ ฎ",
"โ ฏ",
"โกจ",
"โกฉ",
"โกช",
"โกซ",
"โกฌ",
"โกญ",
"โกฎ",
"โกฏ",
"โ ฐ",
"โ ฑ",
"โ ฒ",
"โ ณ",
"โ ด",
"โ ต",
"โ ถ",
"โ ท",
"โกฐ",
"โกฑ",
"โกฒ",
"โกณ",
"โกด",
"โกต",
"โกถ",
"โกท",
"โ ธ",
"โ น",
"โ บ",
"โ ป",
"โ ผ",
"โ ฝ",
"โ พ",
"โ ฟ",
"โกธ",
"โกน",
"โกบ",
"โกป",
"โกผ",
"โกฝ",
"โกพ",
"โกฟ",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข
",
"โข",
"โข",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ
",
"โฃ",
"โฃ",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โข",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โฃ",
"โข ",
"โขก",
"โขข",
"โขฃ",
"โขค",
"โขฅ",
"โขฆ",
"โขง",
"โฃ ",
"โฃก",
"โฃข",
"โฃฃ",
"โฃค",
"โฃฅ",
"โฃฆ",
"โฃง",
"โขจ",
"โขฉ",
"โขช",
"โขซ",
"โขฌ",
"โขญ",
"โขฎ",
"โขฏ",
"โฃจ",
"โฃฉ",
"โฃช",
"โฃซ",
"โฃฌ",
"โฃญ",
"โฃฎ",
"โฃฏ",
"โขฐ",
"โขฑ",
"โขฒ",
"โขณ",
"โขด",
"โขต",
"โขถ",
"โขท",
"โฃฐ",
"โฃฑ",
"โฃฒ",
"โฃณ",
"โฃด",
"โฃต",
"โฃถ",
"โฃท",
"โขธ",
"โขน",
"โขบ",
"โขป",
"โขผ",
"โขฝ",
"โขพ",
"โขฟ",
"โฃธ",
"โฃน",
"โฃบ",
"โฃป",
"โฃผ",
"โฃฝ",
"โฃพ",
"โฃฟ",
},
"line": {
"-",
"\\",
"|",
"/",
},
"line2": {
"โ ",
"-",
"โ",
"โ",
"โ",
"-",
},
"pipe": {
"โค",
"โ",
"โด",
"โ",
"โ",
"โ",
"โฌ",
"โ",
},
"simpleDots": {
". ",
".. ",
"...",
" ",
},
"simpleDotsScrolling": {
". ",
".. ",
"...",
" ..",
" .",
" ",
},
"star": {
"โถ",
"โธ",
"โน",
"โบ",
"โน",
"โท",
},
"star2": {
"+",
"x",
"*",
},
"flip": {
"_",
"_",
"_",
"-",
"`",
"`",
"'",
"ยด",
"-",
"_",
"_",
"_",
},
"hamburger": {
"โฑ",
"โฒ",
"โด",
},
"growVertical": {
"โ",
"โ",
"โ",
"โ
",
"โ",
"โ",
"โ",
"โ
",
"โ",
"โ",
},
"growHorizontal": {
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
},
"balloon": {
" ",
".",
"o",
"O",
"@",
"*",
" ",
},
"balloon2": {
".",
"o",
"O",
"ยฐ",
"O",
"o",
".",
},
"noise": {
"โ",
"โ",
"โ",
},
"bounce": {
"โ ",
"โ ",
"โ ",
"โ ",
},
"boxBounce": {
"โ",
"โ",
"โ",
"โ",
},
"boxBounce2": {
"โ",
"โ",
"โ",
"โ",
},
"triangle": {
"โข",
"โฃ",
"โค",
"โฅ",
},
"arc": {
"โ",
"โ ",
"โ",
"โ",
"โก",
"โ",
},
"circle": {
"โก",
"โ",
"โ ",
},
"squareCorners": {
"โฐ",
"โณ",
"โฒ",
"โฑ",
},
"circleQuarters": {
"โด",
"โท",
"โถ",
"โต",
},
"circleHalves": {
"โ",
"โ",
"โ",
"โ",
},
"squish": {
"โซ",
"โช",
},
"toggle": {
"โถ",
"โท",
},
"toggle2": {
"โซ",
"โช",
},
"toggle3": {
"โก",
"โ ",
},
"toggle4": {
"โ ",
"โก",
"โช",
"โซ",
},
"toggle5": {
"โฎ",
"โฏ",
},
"toggle6": {
"แ",
"แ",
},
"toggle7": {
"โฆพ",
"โฆฟ",
},
"toggle8": {
"โ",
"โ",
},
"toggle9": {
"โ",
"โ",
},
"toggle10": {
"ใ",
"ใ",
"ใ",
},
"toggle11": {
"โง",
"โง",
},
"toggle12": {
"โ",
"โ",
},
"toggle13": {
"=",
"*",
"-",
},
"arrow": {
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
},
"arrow2": {
"โฌ๏ธ ",
"โ๏ธ ",
"โก๏ธ ",
"โ๏ธ ",
"โฌ๏ธ ",
"โ๏ธ ",
"โฌ
๏ธ ",
"โ๏ธ ",
},
"arrow3": {
"โนโนโนโนโน",
"โธโนโนโนโน",
"โนโธโนโนโน",
"โนโนโธโนโน",
"โนโนโนโธโน",
"โนโนโนโนโธ",
},
"bouncingBar": {
"[ ]",
"[= ]",
"[== ]",
"[=== ]",
"[ ===]",
"[ ==]",
"[ =]",
"[ ]",
"[ =]",
"[ ==]",
"[ ===]",
"[====]",
"[=== ]",
"[== ]",
"[= ]",
},
"bouncingBall": {
"( โ )",
"( โ )",
"( โ )",
"( โ )",
"( โ)",
"( โ )",
"( โ )",
"( โ )",
"( โ )",
"(โ )",
},
"smiley": {
"๐ ",
"๐ ",
},
"monkey": {
"๐ ",
"๐ ",
"๐ ",
"๐ ",
},
"hearts": {
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"โค๏ธ ",
},
"clock": {
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
},
"earth": {
"๐ ",
"๐ ",
"๐ ",
},
"material": {
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
"โโโโโโโโโโโโโโโโโโโโ",
},
"moon": {
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
},
"runner": {
"๐ถ ",
"๐ ",
},
"pong": {
"โโ โ",
"โโ โ",
"โ โ โ",
"โ โ โ",
"โ โก โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โก โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โกโ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โก โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โ โ",
"โ โก โ",
"โโ โ",
},
"shark": {
"โ|\\____________โ",
"โ_|\\___________โ",
"โ__|\\__________โ",
"โ___|\\_________โ",
"โ____|\\________โ",
"โ_____|\\_______โ",
"โ______|\\______โ",
"โ_______|\\_____โ",
"โ________|\\____โ",
"โ_________|\\___โ",
"โ__________|\\__โ",
"โ___________|\\_โ",
"โ____________|\\โ",
"โ____________/|โ",
"โ___________/|_โ",
"โ__________/|__โ",
"โ_________/|___โ",
"โ________/|____โ",
"โ_______/|_____โ",
"โ______/|______โ",
"โ_____/|_______โ",
"โ____/|________โ",
"โ___/|_________โ",
"โ__/|__________โ",
"โ_/|___________โ",
"โ/|____________โ",
},
"dqpb": {
"d",
"q",
"p",
"b",
},
"weather": {
"โ๏ธ ",
"โ๏ธ ",
"โ๏ธ ",
"๐ค ",
"โ
๏ธ ",
"๐ฅ ",
"โ๏ธ ",
"๐ง ",
"๐จ ",
"๐ง ",
"๐จ ",
"๐ง ",
"๐จ ",
"โ ",
"๐จ ",
"๐ง ",
"๐จ ",
"โ๏ธ ",
"๐ฅ ",
"โ
๏ธ ",
"๐ค ",
"โ๏ธ ",
"โ๏ธ ",
},
"christmas": {
"๐ฒ",
"๐",
},
"grenade": {
"ุ ",
"โฒ ",
" ยด ",
" โพ ",
" โธ",
" โธ",
" |",
" โ",
" โ",
" เทด ",
" โ",
" ",
" ",
" ",
},
"point": {
"โโโ",
"โโโ",
"โโโ",
"โโโ",
"โโโ",
},
"layer": {
"-",
"=",
"โก",
},
"betaWave": {
"ฯฮฒฮฒฮฒฮฒฮฒฮฒ",
"ฮฒฯฮฒฮฒฮฒฮฒฮฒ",
"ฮฒฮฒฯฮฒฮฒฮฒฮฒ",
"ฮฒฮฒฮฒฯฮฒฮฒฮฒ",
"ฮฒฮฒฮฒฮฒฯฮฒฮฒ",
"ฮฒฮฒฮฒฮฒฮฒฯฮฒ",
"ฮฒฮฒฮฒฮฒฮฒฮฒฯ",
},
"fingerDance": {
"๐ค ",
"๐ค ",
"๐ ",
"โ ",
"๐ค ",
"๐ ",
},
"fistBump": {
"๐คใใใใ๐ค ",
"๐คใใใใ๐ค ",
"๐คใใใใ๐ค ",
"ใ๐คใใ๐คใ ",
"ใใ๐ค๐คใใ ",
"ใ๐คโจ๐คใใ ",
"๐คใโจใ๐คใ ",
},
"soccerHeader": {
" ๐งโฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
"๐ง โฝ๏ธ ๐ง ",
},
"mindblown": {
"๐ ",
"๐ ",
"๐ฎ ",
"๐ฎ ",
"๐ฆ ",
"๐ฆ ",
"๐ง ",
"๐ง ",
"๐คฏ ",
"๐ฅ ",
"โจ ",
"ใ ",
"ใ ",
"ใ ",
},
"speaker": {
"๐ ",
"๐ ",
"๐ ",
"๐ ",
},
"orangePulse": {
"๐ธ ",
"๐ถ ",
"๐ ",
"๐ ",
"๐ถ ",
},
"bluePulse": {
"๐น ",
"๐ท ",
"๐ต ",
"๐ต ",
"๐ท ",
},
"orangeBluePulse": {
"๐ธ ",
"๐ถ ",
"๐ ",
"๐ ",
"๐ถ ",
"๐น ",
"๐ท ",
"๐ต ",
"๐ต ",
"๐ท ",
},
"timeTravel": {
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
"๐ ",
},
"aesthetic": {
"โฐโฑโฑโฑโฑโฑโฑ",
"โฐโฐโฑโฑโฑโฑโฑ",
"โฐโฐโฐโฑโฑโฑโฑ",
"โฐโฐโฐโฐโฑโฑโฑ",
"โฐโฐโฐโฐโฐโฑโฑ",
"โฐโฐโฐโฐโฐโฐโฑ",
"โฐโฐโฐโฐโฐโฐโฐ",
"โฐโฑโฑโฑโฑโฑโฑ",
},
}
Character sets to be used as the spinners
var Symbols = map[string]string{
"success": `โ`,
"failure": `โ`,
"pending": `โ`,
"warning": `โ `,
"unicorn": `๐ฆ`,
"info": `โน`,
}
Some pre-defined symbols for the package
Functions ยถ
func GenerateNumberSequence ยถ
GenerateNumberSequence will generate a slice of integers at the provided length and convert them each to a string.
Types ยถ
type Options ยถ
type Options struct { Color string Text string HideCursor bool Symbol string PrefixText string CharacterSet []string Writer io.Writer Delay time.Duration Padding int DisableElaspedSeconds bool }
Options contains fields to configure the spinner.
type Spinner ยถ
type Spinner struct { Delay time.Duration // Delay is the speed of the indicator Text string // Text shown after the Spinner Writer io.Writer // to make testing better, exported so users have access. Use `WithWriter` to update after initialization. HideCursor bool // hideCursor determines if the cursor is visible PreUpdate func(s *Spinner) // will be triggered before every spinner update PostUpdate func(s *Spinner) // will be triggered after every spinner update Symbol string // Symbol for the spinner, show before PrefixText PrefixText string // PrefixText for the spinner, shown before the spinner and after the Symbol Padding int // Padding for the spinner ShowElaspedSeconds bool // ShowElaspedSeconds determines if the spinner should show the elapsed time // contains filtered or unexported fields }
Spinner struct to hold the provided options.
func (*Spinner) Color ยถ
Color will set the struct field for the given color to be used. The spinner will need to be explicitly restarted.
func (*Spinner) Lock ยถ
func (s *Spinner) Lock()
Lock allows for manual control to lock the spinner.
func (*Spinner) Reverse ยถ
func (s *Spinner) Reverse()
Reverse will reverse the order of the slice assigned to the indicator.
func (*Spinner) StopAndPersist ยถ
Stops the spinner and prints out a symbol with text passed in as arguments
func (*Spinner) Unlock ยถ
func (s *Spinner) Unlock()
Unlock allows for manual control to unlock the spinner.
func (*Spinner) UpdateCharSet ยถ
UpdateCharSet will change the current character set to the given one.
func (*Spinner) UpdateSpeed ยถ
UpdateSpeed will set the indicator delay to the given value.