retry

package
v2.0.0-...-29d9702 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, next http.Handler, config dynamic.Retry, listener Listener, name string) (http.Handler, error)

New returns a new retry middleware.

Types

type Listener

type Listener interface {
	// Retried will be called when a retry happens, with the request attempt passed to it.
	// For the first retry this will be attempt 2.
	Retried(req *http.Request, attempt int)
}

Listener is used to inform about retry attempts.

type Listeners

type Listeners []Listener

Listeners is a convenience type to construct a list of Listener and notify each of them about a retry attempt.

func (Listeners) Retried

func (l Listeners) Retried(req *http.Request, attempt int)

Retried exists to implement the Listener interface. It calls Retried on each of its slice entries.

Jump to

Keyboard shortcuts

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