Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RetryForError ¶
func RetryForError(api func() error, retries int, abort func() bool, sleep time.Duration, logger log.Logger) (err error)
RetryForError call api(), if api() returns a RetryableError, sleep until RetryableError.RetryAfter() duration, retry call api(). sleep 'sleep' duration, call 'abort()', if abort() returns true, returns the last error.
Types ¶
type NetError ¶ added in v1.0.11
type NetError struct {
Err error
// contains filtered or unexported fields
}
func NewNetError ¶ added in v1.0.11
func (*NetError) RetryAfter ¶ added in v1.0.11
type RetryableError ¶ added in v1.0.11
Click to show internal directories.
Click to hide internal directories.