Documentation
¶
Index ¶
- Variables
- type Config
- type Retry
- func (r *Retry) Do(doFunc func() error) error
- func (r *Retry) WithAttempts(n uint) *Retry
- func (r *Retry) WithContext(ctx context.Context) *Retry
- func (r *Retry) WithDelay(d time.Duration) *Retry
- func (r *Retry) WithDelayType(t func(n uint, err error) time.Duration) *Retry
- func (r *Retry) WithMaxDelay(d time.Duration) *Retry
- func (r *Retry) WithMaxJitter(d float64) *Retry
- func (r *Retry) WithOnRetry(onRetry func(uint, error) error) *Retry
- func (r *Retry) WithRetryIf(f func(error) bool) *Retry
Constants ¶
This section is empty.
Variables ¶
View Source
var StandardConfig = &Config{ Attempts: 5, Delay: 1 * time.Second, MaxDelay: 10 * time.Second, MaxJitter: 1.1, Context: context.Background(), }
Functions ¶
This section is empty.
Types ¶
type Retry ¶
type Retry struct {
*Config
}
func (*Retry) WithAttempts ¶
func (*Retry) WithDelayType ¶
func (*Retry) WithMaxJitter ¶
Click to show internal directories.
Click to hide internal directories.