Documentation ¶
Overview ¶
The package "retry" allows exponential backoff retries. The default behavior is as follows.
- Jitter : ON
- First retry delay : 100ms
- Maximum delay : 10s
- Maximum retry count : 5
※These can be changed with arguments.
Index ¶
- func Retry(op Operation, opts ...RetryOption) error
- func RetryOneResult[T any](op OperationOneResult[T], opts ...RetryOption) (*T, error)
- func RetryTwoResults[T1 any, T2 any](op OperationTwoResult[T1, T2], opts ...RetryOption) (*T1, *T2, error)
- type Operation
- type OperationOneResult
- type OperationTwoResult
- type RetryOption
- type RetryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retry ¶
func Retry(op Operation, opts ...RetryOption) error
func RetryOneResult ¶ added in v0.2.0
func RetryOneResult[T any](op OperationOneResult[T], opts ...RetryOption) (*T, error)
func RetryTwoResults ¶ added in v0.2.1
func RetryTwoResults[T1 any, T2 any](op OperationTwoResult[T1, T2], opts ...RetryOption) (*T1, *T2, error)
Types ¶
type OperationOneResult ¶ added in v0.2.0
type OperationTwoResult ¶ added in v0.2.0
type RetryOption ¶
type RetryOption func(*RetryOptions)
func WithoutJitter ¶
func WithoutJitter() RetryOption
type RetryOptions ¶
type RetryOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.