package
5.30.0
Repository: https://github.com/go-playground/pkg.git
Documentation: pkg.go.dev

# Functions

DoRetryable will execute the provided functions code and automatically retry using the provided retry function.
IsRetryable returns true if the provided error is considered retryable by testing if it complies with an interface implementing `Retryable() bool` or `IsRetryable bool` and calling the function.
IsRetryableHTTP returns if the provided error is considered retryable HTTP error.
IsRetryableNetwork returns if the provided error is a retryable network related error.
IsTemporary returns true if the provided error is considered retryable temporary error by testing if it complies with an interface implementing `Temporary() bool` and calling the function.
IsTemporaryConnection returns if the provided error was a low level retryable connection error.
IsTimeout returns true if the provided error is considered a retryable timeout error by testing if it complies with an interface implementing `Timeout() bool` and calling the function.
NewRetryer returns a new `Retryer` with sane default values.

# Constants

MaxAttempts will apply the max attempts to all errors, even those determined to be retryable.
MaxAttemptsNonRetryable will apply the max attempts to all errors not determined to be retryable.
MaxAttemptsNonRetryableReset will apply the max attempts to all errors not determined to be retryable, but will reset the attempts if a retryable error is encountered after a non-retryable error.
MaxAttemptsUnlimited will not apply a maximum number of attempts.

# Variables

ErrMaxAttemptsReached is a placeholder error to use when some retryable even has reached its maximum number of attempts.

# Structs

Retryer is used to retry any fallible operation.

# Type aliases

BackoffFn is a function used to apply a backoff strategy to the retryable function.
EarlyReturnFn is the function that can be used to bypass all retry logic, no matter the MaxAttemptsMode, for when the type of `E` will never succeed and should not be retried.
IsRetryableFn is called to determine if the error is retryable and optionally returns the reason for logging and metrics.
IsRetryableFn2 is called to determine if the type E is retryable.
MaxAttemptsMode is used to set the mode for the maximum number of attempts.
OnRetryFn is called after IsRetryableFn returns true and before the retry is attempted.
RetryableFn is a function that can be retried.