Documentation ¶
Overview ¶
Package spinner provides methods for creating spinner animation for long-running tasks
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var DisableAnimation = false
DisableAnimation is global animation off switch flag
var ErrColorTag = "{r}"
ErrColorTag is cross color tag (see fmtc package)
var ErrSymbol = "✖ "
ErrSymbol contains symbol for action with problems
var OkColorTag = "{g}"
OkColorTag is check color tag (see fmtc package)
var OkSymbol = "✔ "
OkSymbol contains symbol for action with no problems
var SkipColorTag = "{s-}"
SkipColorTag is skipped action color tag (see fmtc package)
var SkipSymbol = "✔ "
SkipSymbol contains symbol for skipped action
var SpinnerColorTag = "{y}"
SpinnerColorTag is spinner animation color tag (see fmtc package)
var TimeColorTag = "{s-}"
TimeColorTag is time color tag (see fmtc package)
Functions ¶
func Done ¶
func Done(ok bool)
Done finishes spinner animation and shows task status
Example ¶
Show("My long running task with good result") time.Sleep(time.Second) Done(true) Show("My long running task with bad result") time.Sleep(time.Second) Done(false)
Output:
func Show ¶
Show shows spinner with given task description
Example ¶
file := "file.txt" // Customize design OkSymbol = "🤟" // Set success status symbol OkColorTag = "{b}" // Set success status symbol color Show("Removing file %s", file) time.Sleep(time.Second) Done(true)
Output:
Types ¶
This section is empty.