package
0.1.158
Repository: https://github.com/searking/golang.git
Documentation: pkg.go.dev

# Packages

The key observation and some code (shr) is borrowed from golang.org/x/time/rate/rate.go.

# Functions

No description provided by the author
No description provided by the author
BackoffUntil 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.
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.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewExponentialBackOff returns a backoff with default limit.
NewExponentialBackOff returns a no limit backoff.
No description provided by the author
NonSlidingUntil loops until context is done, running f every period.
Example: ratio, divide := RatioFrom(fromUnit, toUnit) if divide { toDuration = fromDuration / ratio fromDuration = toDuration * ratio } else { toDuration = fromDuration * ratio fromDuration = toDuration / ratio }.
Timestamp convert time to timestamp reprensent in unit.
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.
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

# Constants

The default initial interval value (0.5 seconds).
The default maximum elapsed count (-1).
The default maximum elapsed time (15 minutes).
The default maximum back off time (1 minute).
The default multiplier value (1.5 which is 50% increase per back off).
The default randomization factor (0.5 which results in a random period ranging between 50% below and 50% above the retry interval).
InfDuration is the duration returned by Delay when a Reservation is not OK.
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.
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.javago:generate go-option -type "ExponentialBackOff".
Fixed back-off policy that always returns {@code #STOP} for {@link #NextBackOff()}, meaning that the operation should not be retried.
https://github.com/golang/go/issues/27169 Timer to fix time: Timer.Stop documentation example easily leads to deadlocks.
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

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

ExponentialBackOffOptionFunc wraps a function that modifies ExponentialBackOff into an implementation of the ExponentialBackOffOption interface.
Fixed back-off policy whose back-off time is always const, meaning that the operation is retried after waiting every duration.
No description provided by the author