Documentation ¶
Index ¶
- Variables
- func Download(url string, filepath string, descPrefix ...string) (int64, error)
- func Exec(name string, args ...string) error
- func ProgressBar(max int64, spin int, theme string, descPrefix ...string) *progressbar.ProgressBar
- func TarGzCompress(srcPath string, target string, verbose bool, descPrefix ...string) error
- func TarGzUncompressing(srcPath string, targetPath string, verbose bool, descPrefix ...string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var PBTheme = map[string]progressbar.Option{
"=>": progressbar.OptionSetTheme(progressbar.Theme{
Saucer: "[green]=[reset]",
SaucerHead: "[green]>[reset]",
SaucerPadding: " ",
BarStart: "[",
BarEnd: "]",
}),
"█": progressbar.OptionSetTheme(progressbar.Theme{
Saucer: "[green]█[reset]",
SaucerHead: "[green] [reset]",
SaucerPadding: " ",
BarStart: "|",
BarEnd: "|",
}),
}
Functions ¶
func Download ¶
descPrefix used for progressbar, format is like "[cyan]1/3[reset]", "Downloading..."
func ProgressBar ¶ added in v1.0.11
If max == -1, enable spinner progress bar, theme if one of PBTheme key
func TarGzCompress ¶
srcPath is the filepath to be compressed, target filename, eg: test.tar.gz
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.