Documentation
¶
Index ¶
- Variables
- func DefaultConfig() schema.RetryConfig
- func Do(ctx context.Context, config *schema.RetryConfig, fn Func) error
- func With7Params[T1 any, T2 any, T3 any, T4 any, T5 any, T6 any, T7 any](ctx context.Context, config *schema.RetryConfig, ...) error
- func WithPredicate(ctx context.Context, config *schema.RetryConfig, fn Func, ...) error
- type Executor
- type Func
- type MaxElapsedTimeError
Constants ¶
This section is empty.
Variables ¶
View Source
var UnexpectedError = errors.New("unexpected end of retry loop")
Functions ¶
func DefaultConfig ¶
func DefaultConfig() schema.RetryConfig
DefaultConfig returns a sensible default configuration.
func With7Params ¶
func WithPredicate ¶
func WithPredicate(ctx context.Context, config *schema.RetryConfig, fn Func, shouldRetry func(error) bool) error
WithPredicate allows you to specify which errors should trigger a retry.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor handles the retry logic.
func New ¶
func New(config schema.RetryConfig) *Executor
New creates a new retry executor with the given config.
type MaxElapsedTimeError ¶
func (MaxElapsedTimeError) Error ¶
func (e MaxElapsedTimeError) Error() string
Click to show internal directories.
Click to hide internal directories.