Documentation ¶
Index ¶
- func Exec(retryableFunc RetryableFunc, strategies ...Strategy) (err error)
- func ExecContext(ctx context.Context, retryableFunc RetryableContextFunc, ...) (err error)
- func Sleep(ctx context.Context, delay time.Duration) (ok bool)
- func Unrecoverable(err error) error
- type AndStrategy
- type DelayedStrategy
- type FixedDelayStrategy
- type FuncStrategy
- type InfiniteAttemptsStrategy
- type IsStrategy
- type LinearDelayStrategy
- type MaxRetriesStrategy
- type NotStrategy
- type OrStrategy
- type PowDelayStrategy
- type RandomDelayStrategy
- type RetryableContextFunc
- type RetryableFunc
- type Strategy
- type StrategyFunc
- type TypeStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
func Exec( retryableFunc RetryableFunc, strategies ...Strategy, ) (err error)
func ExecContext ¶
func ExecContext( ctx context.Context, retryableFunc RetryableContextFunc, strategies ...Strategy, ) (err error)
func Unrecoverable ¶
Types ¶
type AndStrategy ¶
type AndStrategy struct {
// contains filtered or unexported fields
}
func And ¶
func And(strategies ...Strategy) (strategy AndStrategy)
type DelayedStrategy ¶
type DelayedStrategy struct {
// contains filtered or unexported fields
}
func Delays ¶
func Delays(delays ...time.Duration) (strategy *DelayedStrategy)
type FixedDelayStrategy ¶
type FixedDelayStrategy struct {
// contains filtered or unexported fields
}
func FixedDelay ¶
func FixedDelay(delay time.Duration) (strategy FixedDelayStrategy)
type FuncStrategy ¶
type FuncStrategy struct {
// contains filtered or unexported fields
}
func Function ¶
func Function(retryFunc StrategyFunc) (strategy FuncStrategy)
type InfiniteAttemptsStrategy ¶
type InfiniteAttemptsStrategy struct { }
func Infinite ¶
func Infinite() (strategy *InfiniteAttemptsStrategy)
type IsStrategy ¶
type IsStrategy struct {
// contains filtered or unexported fields
}
func Is ¶
func Is(err error) (strategy IsStrategy)
type LinearDelayStrategy ¶
type LinearDelayStrategy struct {
// contains filtered or unexported fields
}
func LinearDelay ¶
func LinearDelay(seed time.Duration, delta time.Duration) (strategy *LinearDelayStrategy)
type MaxRetriesStrategy ¶
type MaxRetriesStrategy struct {
// contains filtered or unexported fields
}
func MaxAttempts ¶
func MaxAttempts(attempts int) (strategy *MaxRetriesStrategy)
type NotStrategy ¶
type NotStrategy struct {
// contains filtered or unexported fields
}
func Not ¶
func Not(originStrategy Strategy) (strategy NotStrategy)
type OrStrategy ¶
type OrStrategy struct {
// contains filtered or unexported fields
}
func Or ¶
func Or(strategies ...Strategy) (strategy OrStrategy)
type PowDelayStrategy ¶
type PowDelayStrategy struct {
// contains filtered or unexported fields
}
type RandomDelayStrategy ¶
type RandomDelayStrategy struct {
// contains filtered or unexported fields
}
func RandomDelay ¶
func RandomDelay(minDelay time.Duration, maxDelay time.Duration) (strategy RandomDelayStrategy)
type RetryableContextFunc ¶
type RetryableFunc ¶
type StrategyFunc ¶
type TypeStrategy ¶
type TypeStrategy struct {
// contains filtered or unexported fields
}
func Type ¶
func Type(err error) (strategy TypeStrategy)
Click to show internal directories.
Click to hide internal directories.