retry

package
v2.0.0-beta1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: MIT Imports: 11 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