Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct { Updater // contains filtered or unexported fields }
A Counter tracks a running count and controls a goroutine that passes its value periodically to a Func.
The Func is also called when SIGUSR1 (or SIGINFO, on BSD) is received.
func NewCounter ¶
NewCounter starts a new Counter.
type Func ¶
A Func is a callback for a Counter.
The final argument is true if Counter.Done has been called, which means that the current call will be the last.
type UpdateFunc ¶
An UpdateFunc is a callback for a (progress) Updater.
The final argument is true if Updater.Done has been called, which means that the current call will be the last.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
An Updater controls a goroutine that periodically calls an UpdateFunc.
The UpdateFunc is also called when SIGUSR1 (or SIGINFO, on BSD) is received.
func NewUpdater ¶
func NewUpdater(interval time.Duration, report UpdateFunc) *Updater
NewUpdater starts a new Updater.