modulepackage
1.0.3
Repository: https://github.com/weathersource/go-retry.git
Documentation: pkg.go.dev
# README
go-retry
Package retry enables automatic retry of code. This package is goroutine-safe and supports: constant backoff, exponential backoff, conditional retries.
This package started with avast/retry-go and jpillora/backoff and grew from there.
# Functions
Do is the main function of the retry package.
WithAttempts configures the number of retry attampts.
WithConditionalRetry configures conditions upon which a retry should be attempted.
WithConstantBackoff configures a constant delay between retries.
WithExponentialBackoff configures an exponential delay between retries.
# Constants
DefaultAttempts is the default number of retry attempts.
DefaultFactor is the default exponential factor for delay growth between retries.
DefaultInitDelay is the default initial delay between retries.
DefaultMaxDelay is the default maximum delay between retries.
# Type aliases
ConditionalRetryFunc is the function signature for a conditional retry function passed to WithConditionalRetry(...).
Option is the type of constructor options for Do(...).
RetryableFunc is a function signature for a retryable function passed to the Do function.