DefaultConfig returns a Config with sensible default values
()
| 18 | |
| 19 | // DefaultConfig returns a Config with sensible default values |
| 20 | func DefaultConfig() Config { |
| 21 | return Config{ |
| 22 | MaxRetries: 3, |
| 23 | InitialWait: 1 * time.Second, |
| 24 | MaxWait: 10 * time.Second, |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | // WithBackoff executes the given operation with exponential backoff retry logic |
| 29 | func WithBackoff(ctx context.Context, cfg Config, operation func() error) error { |