sdk

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRetryAfter added in v1.0.27

func GetRetryAfter(a any) time.Duration

func RetryForError

func RetryForError(ctx context.Context, api func() error, retries int, logger log.Logger) error

RetryForError loop max `retries` count to call api(). returns the error if api() returns a non Retryable error.

Types

type RetryError added in v1.0.27

type RetryError struct {
	Err        error
	RetryAfter time.Duration
}

func NewRetryError added in v1.0.27

func NewRetryError(err error, retryAfter ...time.Duration) *RetryError

func (*RetryError) Error added in v1.0.27

func (re *RetryError) Error() string

func (*RetryError) GetRetryAfter added in v1.0.27

func (re *RetryError) GetRetryAfter() time.Duration

func (*RetryError) Unwrap added in v1.0.27

func (re *RetryError) Unwrap() error

type Retryable added in v1.0.16

type Retryable interface {
	GetRetryAfter() time.Duration
}

Directories

Path Synopsis
fdk

Jump to

Keyboard shortcuts

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