retry

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolError

type BoolError struct {
	Message string
	Attempt func() (bool, error)
}

BoolError is an error we can retry

func (BoolError) Error

func (e BoolError) Error() string

func (BoolError) Retry

func (e BoolError) Retry() (bool, error)

Retry makes another attempt

type BoolRetryable

type BoolRetryable interface {
	Retry() (bool, error)
}

BoolRetryable errors can be retried if the caller wants

func BoolCheck

func BoolCheck(err error) (BoolRetryable, bool)

BoolCheck will give a Retryable and true if we can try again

type Error

type Error struct {
	Message string
	Attempt func() error
}

Error is an error we can retry

func (Error) Error

func (e Error) Error() string

func (Error) Retry

func (e Error) Retry() error

Retry makes another attempt

type Retryable

type Retryable interface {
	Retry() error
}

Retryable errors can be retried if the caller wants

func Check

func Check(err error) (Retryable, bool)

Check will give a Retryable and true if we can try again

type StringError

type StringError struct {
	Message string
	Attempt func() (string, error)
}

StringError is an error we can retry

func (StringError) Error

func (e StringError) Error() string

func (StringError) Retry

func (e StringError) Retry() (string, error)

Retry makes another attempt

type StringRetryable

type StringRetryable interface {
	Retry() (string, error)
}

StringRetryable errors can be retried if the caller wants

func StringCheck

func StringCheck(err error) (StringRetryable, bool)

StringCheck will give a Retryable and true if we can try again

type TimeError

type TimeError struct {
	Message string
	Attempt func() (time.Time, error)
}

TimeError is an error we can retry

func (TimeError) Error

func (e TimeError) Error() string

func (TimeError) Retry

func (e TimeError) Retry() (time.Time, error)

Retry makes another attempt

type TimeRetryable

type TimeRetryable interface {
	Retry() (string, error)
}

TimeRetryable errors can be retried if the caller wants

func TimeCheck

func TimeCheck(err error) (TimeRetryable, bool)

TimeCheck will give a Retryable and true if we can try again

Jump to

Keyboard shortcuts

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