resiliency

package
v1.16.4 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRetryable

func IsRetryable(e error) bool

IsRetryable checks if an error can be retried.

func Retry added in v1.15.0

func Retry(ctx context.Context, duration time.Duration, maxRetries int, fn RetryFunc) error

Retry retries the provided call using exponential retries given an initial duration for up to max retries count.

func Retryable added in v1.15.0

func Retryable(e error) retryableErr

Retryable returns a new instance.

Types

type ErrorSet added in v1.15.0

type ErrorSet struct {
	// contains filtered or unexported fields
}

ErrorSet tracks a collection of unique errors.

func NewErrorSet added in v1.15.0

func NewErrorSet(msg string, c int) *ErrorSet

NewErrorSet returns a new instance.

func (*ErrorSet) Add added in v1.15.0

func (e *ErrorSet) Add(errs ...error)

Add adds one or more errors to the set.

func (*ErrorSet) Error added in v1.15.0

func (e *ErrorSet) Error() error

Error returns a new composite error or nil.

func (*ErrorSet) Errors added in v1.15.0

func (e *ErrorSet) Errors() []error

Error returns a list of unique errors or nil.

type RetryFunc added in v1.15.0

type RetryFunc func(ctx context.Context, retries int) (bool, error)

RetryFunc tracks resiliency retry calls.

Jump to

Keyboard shortcuts

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