Documentation ¶
Index ¶
- func HumanElapsed(start time.Time) time.Duration
- func Logf(format string, a ...any)
- func Printf(format string, a ...any)
- func Println(a ...any)
- func SetOutputOptions(verb Verbosity, animation bool)
- func WithProgress(name string, fn func() error) error
- func WithProgressParallel(wg *sync.WaitGroup, name string, c *uint64, n uint64)
- type Options
- type Verbosity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HumanElapsed ¶
HumanElapsed returns the time elapsed since the given start time truncated to 100x the highest non-zero duration unit (ns, us, ms, ...). This tends to create very short duration strings when printed (e.g. 725.8ms) without having to fiddle too much with
func SetOutputOptions ¶
func WithProgress ¶
WithProgress prints a spinner while the given function is active.
func WithProgressParallel ¶
WithProgressParallel will continuously print progress to stdout until the given wait group counter goes to zero. Progress is determined by the values of `c` (number of tasks completed) and the value `n` (total number of tasks).
Types ¶
Click to show internal directories.
Click to hide internal directories.