mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 18:51:19 +00:00
dd3ac6c2ed
* begin migration logic * wrote migration logic * begin test file * test for migration working * gaz * progressutil * migration works even if partial data was written
28 lines
718 B
Go
28 lines
718 B
Go
package progressutil
|
|
|
|
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),
|
|
)
|
|
}
|