This is mostly a for-fun
project as an excuse to mess with some things I don't
normally have a reason to use. There are other similar projects that may be more
mature.
-- import "github.com/ckaznocha/busyIndicator"
var (
//Spin is a standard spinner
Spin = []string{"-", "\\", "|", "/"}
//Dot is an ellipsis sequence
Dot = []string{"", ".", "..", "..."}
//Grow is a . that grows up to be an O
Grow = []string{".", "ₒ", "ⱺ", "O", "ⱺ", "ₒ", "."}
)
func Progress(
marks ProgressMarks,
progress chan float64,
cancel chan bool,
)
Progress starts a progress bar
func ProgressAnimated(
marks ProgressMarks,
speed time.Duration,
progress chan float64,
cancel chan bool,
)
ProgressAnimated starts an animated progress bar
func Throbber(
vals []string,
speed time.Duration,
c chan bool,
)
Throbber starts a throbber
func ThrobberPostfixed(
postfix string,
vals []string,
speed time.Duration,
c chan bool,
)
ThrobberPostfixed starts a throbber with a given static postfix
func ThrobberPrefixed(
prefix string,
vals []string,
speed time.Duration,
c chan bool,
)
ThrobberPrefixed starts a throbber with a given static prefix
func ThrobberPrefixedAndPostfixed(
prefix string,
postfix string,
vals []string,
speed time.Duration,
c chan bool,
)
ThrobberPrefixedAndPostfixed starts a throbber with a given static prefix and postfix
type ProgressMarks struct {
Completed rune
Incomplete rune
}
ProgressMarks holds the runes you'd like to use for your progress bar