Documentation ¶
Overview ¶
Package backoff provides backoff function controller
Package backoff provides backoff function controller
Index ¶
- type Backoff
- type Option
- func WithBackOffFactor(f float64) Option
- func WithBackOffTimeLimit(dur string) Option
- func WithDisableErrorLog() Option
- func WithEnableErrorLog() Option
- func WithInitialDuration(dur string) Option
- func WithJitterLimit(dur string) Option
- func WithMaximumDuration(dur string) Option
- func WithRetryCount(c int) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff interface { Do(context.Context, func(ctx context.Context) (interface{}, bool, error)) (interface{}, error) Close() }
Backoff represents an interface to handle backoff operation.
type Option ¶
type Option func(*backoff)
Option represents the functional option for backoff.
func WithBackOffFactor ¶
WithBackOffFactor returns the option to set the factor of backoff.
func WithBackOffTimeLimit ¶
WithBackOffTimeLimit returns the option to set the limit of backoff.
func WithDisableErrorLog ¶
func WithDisableErrorLog() Option
WithDisableErrorLog returns the option to set the disable for error log.
func WithEnableErrorLog ¶
func WithEnableErrorLog() Option
WithEnableErrorLog returns the option to set the enable for error log.
func WithInitialDuration ¶
WithInitialDuration returns the option to set the initial duration of backoff.
func WithJitterLimit ¶
WithJitterLimit returns the option to set the jitter limit duration of backoff.
func WithMaximumDuration ¶
WithMaximumDuration returns the option to set the maximum duration of backoff.
func WithRetryCount ¶
WithRetryCount returns the option to set the retry count of backoff.