retry

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func Register

func Register(ctx context.Context, client *resty.Client) error

Register register a retry to resty client

Types

type Options

type Options struct {
	Enabled     bool
	Count       int
	WaitTime    time.Duration
	MaxWaitTime time.Duration
}

Options represents a retry plugin for resty client options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals a given key path into options and returns it.

type Retry

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

Retry represents a retry plugin for resty client.

func NewRetry

func NewRetry() *Retry

NewRetry returns a new Retry.

func NewRetryWithConfigPath

func NewRetryWithConfigPath(path string) (*Retry, error)

NewRetryWithConfigPath returns a new Retry with options from config path.

func NewRetryWithOptions

func NewRetryWithOptions(options *Options) *Retry

NewRetryWithOptions returns a new Retry with options.

func (*Retry) Register

func (p *Retry) Register(ctx context.Context, client *resty.Client) error

Register registers retry in resty.

Jump to

Keyboard shortcuts

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