backoff

package
v1.89.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBackoff

func WithBackoff(config Config) heartbeat.HandleOption

WithBackoff initializes and returns a heartbeat handle option, which can be used in a heartbeat processing pipeline to prevent trying to send a heartbeat when the api is unresponsive.

Types

type Config

type Config struct {
	// At is the time when the first failure happened.
	At time.Time
	// Retries is the number of attempts to connect.
	Retries int
	// V is an instance of Viper.
	V *viper.Viper
	// HasProxy is true when using a proxy
	HasProxy bool
}

Config defines backoff data.

Jump to

Keyboard shortcuts

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