Add bar creation
This commit is contained in:
parent
bae3516693
commit
7d11b12bc2
27
v1/internal/bar/bar.go
Normal file
27
v1/internal/bar/bar.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package bar
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/schollz/progressbar/v3"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Return a new ProgressBar
|
||||||
|
func New(tasks int) *progressbar.ProgressBar {
|
||||||
|
return progressbar.NewOptions(tasks,
|
||||||
|
progressbar.OptionSetWriter(os.Stderr),
|
||||||
|
progressbar.OptionShowCount(),
|
||||||
|
progressbar.OptionShowIts(),
|
||||||
|
progressbar.OptionSetPredictTime(false),
|
||||||
|
progressbar.OptionClearOnFinish(),
|
||||||
|
progressbar.OptionEnableColorCodes(true),
|
||||||
|
progressbar.OptionSetWidth(40),
|
||||||
|
progressbar.OptionSetTheme(progressbar.Theme{
|
||||||
|
Saucer: "[blue]=[reset]",
|
||||||
|
SaucerHead: "[blue]>[reset]",
|
||||||
|
SaucerPadding: " ",
|
||||||
|
BarStart: "[",
|
||||||
|
BarEnd: "]",
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user