backoff

package
v0.0.40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package backoff provides backoff function controller

Package backoff provides backoff function controller

Index

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() (interface{}, error)) (interface{}, error)
	Close()
}

func New

func New(opts ...Option) Backoff

type Option

type Option func(*backoff)

func WithBackOffFactor

func WithBackOffFactor(f float64) Option

func WithBackOffTimeLimit

func WithBackOffTimeLimit(dur string) Option

func WithDisableErrorLog

func WithDisableErrorLog() Option

func WithEnableErrorLog

func WithEnableErrorLog() Option

func WithInitialDuration

func WithInitialDuration(dur string) Option

func WithJitterLimit

func WithJitterLimit(dur string) Option

func WithMaximumDuration

func WithMaximumDuration(dur string) Option

func WithRetryCount

func WithRetryCount(c int) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL