retries

package
v1.20.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: MIT Imports: 3 Imported by: 0

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