mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
9935ca3733
* add tracing * monitoring pkg * move prom * Add client stats Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
28 lines
714 B
Go
28 lines
714 B
Go
package progress
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/k0kubun/go-ansi"
|
|
"github.com/schollz/progressbar/v3"
|
|
)
|
|
|
|
// InitializeProgressBar standard for use in Prysm.
|
|
func InitializeProgressBar(numItems int, msg string) *progressbar.ProgressBar {
|
|
return progressbar.NewOptions(
|
|
numItems,
|
|
progressbar.OptionFullWidth(),
|
|
progressbar.OptionSetWriter(ansi.NewAnsiStdout()),
|
|
progressbar.OptionEnableColorCodes(true),
|
|
progressbar.OptionSetTheme(progressbar.Theme{
|
|
Saucer: "[green]=[reset]",
|
|
SaucerHead: "[green]>[reset]",
|
|
SaucerPadding: " ",
|
|
BarStart: "[",
|
|
BarEnd: "]",
|
|
}),
|
|
progressbar.OptionOnCompletion(func() { fmt.Println() }),
|
|
progressbar.OptionSetDescription(msg),
|
|
)
|
|
}
|