retryresource

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 8 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func New

func New(config Config) (resource.Interface, error)

New returns a new retry resource according to the configured resource's implementation, which might be resource.Interface or crud.Interface. This has then different implications on how to retry the different methods of the interfaces.

func Wrap

func Wrap(resources []resource.Interface, config WrapConfig) ([]resource.Interface, error)

Wrap wraps each given resource with a retry resource and returns the list of wrapped resources.

Types

type Config

type Config struct {
	BackOff  backoff.Interface
	Logger   micrologger.Logger
	Resource resource.Interface
}

type WrapConfig

type WrapConfig struct {
	BackOffFactory func() backoff.Interface
	Logger         micrologger.Logger
}

WrapConfig is the configuration used to wrap resources with retry resources.

Jump to

Keyboard shortcuts

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