retry

package
v0.0.0-...-3568c51 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action func(attempt uint) error

Action defines the prototype of action function, function as a value

type Model

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

Model defines the schema, contains all the attributes need for retry

func Timeout

func Timeout(timeout int64) *Model

Timeout is used to define the timeout duration for each iteration of retry it will run if the instance of model is not present before

func Times

func Times(retry uint) *Model

Times is used to define the retry count it will run if the instance of model is not present before

func Wait

func Wait(waitTime time.Duration) *Model

Wait is used to define the wait duration after each iteration of retry it will run if the instance of model is not present before

func (*Model) Timeout

func (model *Model) Timeout(timeout int64) *Model

Timeout is used to define the timeout duration for each iteration of retry it will run if the instance of model is already present

func (*Model) Times

func (model *Model) Times(retry uint) *Model

Times is used to define the retry count it will run if the instance of model is already present

func (Model) Try

func (model Model) Try(action Action) error

Try is used to run a action with retries and some delay after each iteration

func (Model) TryWithTimeout

func (model Model) TryWithTimeout(action Action) error

TryWithTimeout is used to run a action with retries for each iteration of retry there will be some timeout

func (*Model) Wait

func (model *Model) Wait(waitTime time.Duration) *Model

Wait is used to define the wait duration after each iteration of retry it will run if the instance of model is already present

Jump to

Keyboard shortcuts

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