Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NeverAbort ¶ added in v1.0.15
func NeverAbort() bool
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 Retryable error, sleep until Retryable.GetRetryAfter() duration, retry call api(). sleep 'sleep' duration, call 'abort()', if abort() returns true, returns the last error.
func SleepForRetry ¶ added in v1.0.15
SleepForRetry sleep until 'after' duration elapsed. call 'abort()' every 'sleep' interval, if abort() returns true, returns false. if 'sleep' <= 0, 'sleep' = time.Second. if 'sleep' > 'after', 'sleep' = 'after'.
Types ¶
type NetError ¶ added in v1.0.11
func NewNetError ¶ added in v1.0.11
func (*NetError) GetRetryAfter ¶ added in v1.0.15
Click to show internal directories.
Click to hide internal directories.