retries

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package retries implements backoff strategies around a standard configuration scheme.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backoff

type Backoff struct {
	InitialInterval string `json:"initial_interval" yaml:"initial_interval"`
	MaxInterval     string `json:"max_interval" yaml:"max_interval"`
	MaxElapsedTime  string `json:"max_elapsed_time" yaml:"max_elapsed_time"`
}

Backoff contains configuration params for the exponential backoff of the retry mechanism.

type Config

type Config struct {
	MaxRetries uint64  `json:"max_retries" yaml:"max_retries"`
	Backoff    Backoff `json:"backoff" yaml:"backoff"`
}

Config contains configuration params for a retries mechanism.

func NewConfig

func NewConfig() Config

NewConfig creates a new Config with default values.

func (*Config) Get

func (c *Config) Get() (backoff.BackOff, error)

Get returns a valid *backoff.ExponentialBackoff based on the configuration values of Config.

func (*Config) GetCtor added in v0.35.0

func (c *Config) GetCtor() (func() backoff.BackOff, error)

GetCtor returns a constructor for a backoff.Backoff based on the configuration values of Config.

Jump to

Keyboard shortcuts

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