# Packages
Package rate The key observation and some code is borrowed from golang.org/x/time/rate/rate.go.
# Functions
Deprecated: Use [time.After] instead since go1.23.
Deprecated: Use [time.AfterFunc] instead since go1.23.
BackoffUntil loops until context is done, run f every duration given by BackoffManager.
BackoffUntilWithReset loops until context is done, run f every duration given by BackoffManager.
ConvertTimestamp convert timestamp from one unit to another unit.
Forever calls f every period for ever.
ForeverWithReset calls f every period for ever.
Jitter returns a time.Duration between [duration - maxFactor*duration, duration + maxFactor*duration].
JitterBackOff returns a time.Duration between [duration - maxFactor*duration, duration + maxFactor*duration].
JitterUntil loops until context is done, running f every period.
JitterUntilWithReset loops until context is done, running f every period.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewDefaultExponentialBackOff returns a backoff with default limit.
NewExponentialBackOff returns a no limit backoff.
NewGrpcExponentialBackOff is a backoff from configuration with the default values specified at https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md.
Deprecated: Use [time.NewTimer] instead since go1.23.
NonSlidingUntil loops until context is done, running f every period.
NonSlidingUntilWithReset loops until context is done, running f every period.
RatioFrom Example: ratio, divide := RatioFrom(fromUnit, toUnit)
if divide { toDuration = fromDuration / ratio fromDuration = toDuration * ratio } else {
toDuration = fromDuration * ratio fromDuration = toDuration / ratio }.
Timestamp returns a Unix timestamp in unit from "January 1, 1970 UTC".
TruncateByLocation only happens in local semantics, apparently.
UnixWithUnit returns the local Time corresponding to the given Unix time by unit.
Until loops until context is done, running f every period.
UntilWithReset loops until context is done, running f every period.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Deprecated: Use [time.Timer] instead since go1.23.
# Constants
DefaultInitialInterval The default initial interval value (0.5 seconds).
DefaultMaxElapsedCount The default maximum elapsed count (-1).
DefaultMaxElapsedDuration The default maximum elapsed time (15 minutes).
DefaultMaxInterval The default maximum back off time (1 minute).
DefaultMultiplier The default multiplier value (1.5 which is 50% increase per back off).
DefaultRandomizationFactor The default randomization factor (0.5 which results in a random period ranging between 50% below and 50% above the retry interval).
yyyymmdd hh:mm:ss.uuuuuu.
mmdd hh:mm:ss.uuuuuu.
InfDuration is the duration returned by Delay when a Reservation is not OK.
ZeroBackOff Fixed back-off policy whose back-off time is always zero, meaning that the operation is retried
immediately without waiting.
# Structs
No description provided by the author
No description provided by the author
EmptyExponentialBackOffOption does not alter the configuration.
ExponentialBackOff Code borrowed from https://github.com/googleapis/google-http-java-client/blob/master/google-http-client/ src/main/java/com/google/api/client/util/ExponentialBackOff.java
go:generate go-option -type "ExponentialBackOff".
StopBackOff Fixed back-off policy that always returns {@code #STOP} for {@link #NextBackOff()}, meaning that the operation should not be retried.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
BackOff Code borrowed from https://github.com/googleapis/google-http-java-client/blob/master/google-http-client/ src/main/java/com/google/api/client/util/BackOff.java.
A ExponentialBackOffOption sets options.
# Type aliases
Duration is alias of time.Duration for marshal and unmarshal.
ExponentialBackOffOptionFunc wraps a function that modifies ExponentialBackOff into an implementation of the ExponentialBackOffOption interface.
NonSlidingBackOff Fixed back-off policy whose back-off time is always const, meaning that the operation is retried after waiting every duration.
Timer to fix time: Timer.Stop documentation example easily leads to deadlocks https://github.com/golang/go/issues/27169
Deprecated: Use [time.Timer] instead since go1.23.
No description provided by the author