Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/Rican7/retry
/ functions
Functions
53 in github.com/Rican7/retry
⨍
Functions
53
◇
Types & classes
4
↓ 10 callers
Function
shouldAttempt
shouldAttempt evaluates the provided strategies with the given attempt to determine if the Retry loop should make another attempt.
retry.go:28
↓ 7 callers
Function
Retry
Retry takes an action and performs it, repetitively, until successful. Optionally, strategies may be passed that assess whether or not an attempt sho
retry.go:16
↓ 6 callers
Function
fallbackNewRandom
fallbackNewRandom returns the passed in random instance if it's not nil, and otherwise returns a new random instance seeded with the current time.
jitter/jitter.go:80
↓ 3 callers
Function
BackoffWithJitter
BackoffWithJitter creates a Strategy that waits before each attempt, with a duration as defined by the given backoff.Algorithm and jitter.Transformati
strategy/strategy.go:70
↓ 3 callers
Function
BinaryExponential
BinaryExponential creates a Algorithm that multiplies the factor duration by an exponentially increasing factor for each attempt, where the factor is
backoff/backoff.go:44
↓ 3 callers
Function
Exponential
Exponential creates a Algorithm that multiplies the factor duration by an exponentially increasing factor for each attempt, where the factor is calcul
backoff/backoff.go:35
↓ 3 callers
Function
Fibonacci
Fibonacci creates a Algorithm that multiplies the factor duration by an increasing factor for each attempt, where the factor is the Nth number in the
backoff/backoff.go:51
↓ 3 callers
Function
Limit
Limit creates a Strategy that limits the number of attempts that Retry will make.
strategy/strategy.go:25
↓ 3 callers
Function
Wait
Wait creates a Strategy that waits the given durations for each attempt after the first. If the number of attempts is greater than the number of durat
strategy/strategy.go:46
↓ 3 callers
Function
fibonacciNumber
fibonacciNumber calculates the Fibonacci sequence number for the given sequence position.
backoff/backoff.go:59
↓ 2 callers
Function
Backoff
Backoff creates a Strategy that waits before each attempt, with a duration as defined by the given backoff.Algorithm.
strategy/strategy.go:64
↓ 2 callers
Function
Deviation
Deviation creates a Transformation that transforms a duration into a result duration that deviates from the input randomly by a given factor. The giv
jitter/jitter.go:53
↓ 2 callers
Function
Incremental
Incremental creates a Algorithm that increments the initial duration by the given increment for each attempt.
backoff/backoff.go:18
↓ 2 callers
Function
Linear
Linear creates a Algorithm that linearly multiplies the factor duration by the attempt number for each attempt.
backoff/backoff.go:26
↓ 2 callers
Function
noJitter
noJitter creates a jitter.Transformation that simply returns the input.
strategy/strategy.go:81
↓ 1 callers
Function
Delay
Delay creates a Strategy that waits the given duration before the first attempt is made.
strategy/strategy.go:33
↓ 1 callers
Function
Equal
Equal creates a Transformation that transforms a duration into a result duration in [n/2, n) randomly, where n is the given duration. The given gener
jitter/jitter.go:38
↓ 1 callers
Function
Full
Full creates a Transformation that transforms a duration into a result duration in [0, n) randomly, where n is the given duration. The given generato
jitter/jitter.go:23
↓ 1 callers
Function
NormalDistribution
NormalDistribution creates a Transformation that transforms a duration into a result duration based on a normal distribution of the input and the give
jitter/jitter.go:70
Function
Example
()
example_test.go:18
Function
ExampleBinaryExponential
()
backoff/backoff_test.go:151
Function
ExampleExponential
()
backoff/backoff_test.go:134
Function
ExampleFibonacci
()
backoff/backoff_test.go:168
Function
ExampleIncremental
()
backoff/backoff_test.go:100
Function
ExampleLinear
()
backoff/backoff_test.go:117
Function
Example_fileOpen
()
example_test.go:24
Function
Example_httpGetWithStrategies
()
example_test.go:44
Function
Example_withBackoffJitter
()
example_test.go:70
Function
TestBackoff
(t *testing.T)
strategy/strategy_test.go:118
Function
TestBackoffWithJitter
(t *testing.T)
strategy/strategy_test.go:152
Function
TestBinaryExponential
(t *testing.T)
backoff/backoff_test.go:57
Function
TestDelay
(t *testing.T)
strategy/strategy_test.go:36
Function
TestDeviation
(t *testing.T)
jitter/jitter_test.go:49
Function
TestEqual
(t *testing.T)
jitter/jitter_test.go:29
Function
TestExponential
(t *testing.T)
backoff/backoff_test.go:41
Function
TestFallbackNewRandom
(t *testing.T)
jitter/jitter_test.go:91
Function
TestFibonacci
(t *testing.T)
backoff/backoff_test.go:72
Function
TestFibonacciNumber
(t *testing.T)
backoff/backoff_test.go:87
Function
TestFull
(t *testing.T)
jitter/jitter_test.go:9
Function
TestIncremental
(t *testing.T)
backoff/backoff_test.go:10
Function
TestLimit
(t *testing.T)
strategy/strategy_test.go:12
Function
TestLinear
(t *testing.T)
backoff/backoff_test.go:26
Function
TestNoJitter
(t *testing.T)
strategy/strategy_test.go:190
Function
TestNormalDistribution
(t *testing.T)
jitter/jitter_test.go:70
Function
TestRetry
(t *testing.T)
retry_test.go:8
Function
TestRetryAttemptNumberIsAccurate
(t *testing.T)
retry_test.go:20
Function
TestRetryRetriesUntilNoErrorReturned
(t *testing.T)
retry_test.go:57
Function
TestShouldAttempt
(t *testing.T)
retry_test.go:87
Function
TestShouldAttemptWithMultipleStrategies
(t *testing.T)
retry_test.go:121
Function
TestShouldAttemptWithStrategy
(t *testing.T)
retry_test.go:95
Function
TestWait
(t *testing.T)
strategy/strategy_test.go:53
Function
TestWaitWithDuration
(t *testing.T)
strategy/strategy_test.go:65
Function
TestWaitWithMultipleDurations
(t *testing.T)
strategy/strategy_test.go:82