Versions in this module Expand all Collapse all v1 v1.48.1 Aug 21, 2019 Changes in this version + func IsRetryAfter(err error) (retryAfter time.Duration, isRetryAfter bool) + func RetryAfterError(err error, retryAfter time.Duration) error + type AmazonCloudDrive struct + func NewAmazonCloudDrive(opts ...AmazonCloudDriveOption) *AmazonCloudDrive + func (c *AmazonCloudDrive) Calculate(state State) time.Duration + func (c *AmazonCloudDrive) Update(opts ...AmazonCloudDriveOption) + type AmazonCloudDriveOption interface + ApplyAmazonCloudDrive func(*AmazonCloudDrive) + type AttackConstant uint + func (o AttackConstant) ApplyDefault(c *Default) + func (o AttackConstant) ApplyS3(c *S3) + type Burst int + func (o Burst) ApplyGoogleDrive(c *GoogleDrive) + type Calculator interface + Calculate func(state State) time.Duration + type DecayConstant uint + func (o DecayConstant) ApplyDefault(c *Default) + func (o DecayConstant) ApplyS3(c *S3) + type Default struct + func NewDefault(opts ...DefaultOption) *Default + func (c *Default) Calculate(state State) time.Duration + func (c *Default) Update(opts ...DefaultOption) + type DefaultOption interface + ApplyDefault func(*Default) + type GoogleDrive struct + func NewGoogleDrive(opts ...GoogleDriveOption) *GoogleDrive + func (c *GoogleDrive) Calculate(state State) time.Duration + func (c *GoogleDrive) Update(opts ...GoogleDriveOption) + type GoogleDriveOption interface + ApplyGoogleDrive func(*GoogleDrive) + type InvokerFunc func(try, tries int, f Paced) (bool, error) + type MaxSleep time.Duration + func (o MaxSleep) ApplyDefault(c *Default) + func (o MaxSleep) ApplyS3(c *S3) + type MinSleep time.Duration + func (o MinSleep) ApplyAmazonCloudDrive(c *AmazonCloudDrive) + func (o MinSleep) ApplyDefault(c *Default) + func (o MinSleep) ApplyGoogleDrive(c *GoogleDrive) + func (o MinSleep) ApplyS3(c *S3) + type Option func(*pacerOptions) + func CalculatorOption(c Calculator) Option + func InvokerOption(invoker InvokerFunc) Option + func MaxConnectionsOption(maxConnections int) Option + func RetriesOption(retries int) Option + type Paced func() (bool, error) + type Pacer struct + func New(options ...Option) *Pacer + func (p *Pacer) Call(fn Paced) (err error) + func (p *Pacer) CallNoRetry(fn Paced) error + func (p *Pacer) ModifyCalculator(f func(Calculator)) + func (p *Pacer) SetCalculator(c Calculator) + func (p *Pacer) SetMaxConnections(n int) + func (p *Pacer) SetRetries(retries int) + type S3 struct + func NewS3(opts ...S3Option) *S3 + func (c *S3) Calculate(state State) time.Duration + func (c *S3) Update(opts ...S3Option) + type S3Option interface + ApplyS3 func(*S3) + type State struct + ConsecutiveRetries int + LastError error + SleepTime time.Duration + type TokenDispenser struct + func NewTokenDispenser(n int) *TokenDispenser + func (td *TokenDispenser) Get() + func (td *TokenDispenser) Put()