repeaterx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedErrors

type AllowedErrors struct {
	strategy.Interface
}

AllowedErrors wraps the strategy.Interface with general Do method. It returns error if the error, returned by lambda is NOT in the list of provided errors.

func NewAllowedErrors

func NewAllowedErrors(strtg strategy.Interface) *AllowedErrors

NewAllowedErrors makes new instance of AllowedErrors. If strategy=nil initializes with FixedDelay 5sec, 10 times.

func (AllowedErrors) Do

func (r AllowedErrors) Do(ctx context.Context, fun func() error, errs ...error) (err error)

Do repeats fun till error returned by it either is not in the list or nil. It considers every non-listed errors as allowed for repeating and non-critical.

Jump to

Keyboard shortcuts

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