type Waiter struct {
// MinFailures before exponential backoff starts. Any failures before// MinFailures is reached will wait MinWait time.
MinFailures uint// MinWait time. Returned after the first failure. MinWait time.Duration// MaxWait time. MaxWait time.Duration// Jitter to add to each wait time. Jitter Jitter// Factor is the multiplier to use when calculating the delay. Defaults to// 1 second.
Factor time.Duration// contains filtered or unexported fields
}
Waiter records the number of failures and performs exponential backoff when
when there are consecutive failures.
Wait increase the number of failures by one, and then blocks until the context
is cancelled, or until the wait time is reached.
The wait time increases exponentially as the number of failures increases.
Wait will return ctx.Err() if the context is cancelled.