network

package
v3.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is429Or5XXError

func Is429Or5XXError(err error) bool

func RetryWithClient

func RetryWithClient[T any, R any](ctx context.Context, p *ProtonClientRetryWrapper[T], f func(context.Context, T) (R, error)) (R, error)

Types

type CoolDownProvider

type CoolDownProvider interface {
	GetNextWaitTime() time.Duration
	Reset()
}

type ExpCoolDown

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

func (*ExpCoolDown) GetNextWaitTime

func (c *ExpCoolDown) GetNextWaitTime() time.Duration

func (*ExpCoolDown) Reset

func (c *ExpCoolDown) Reset()

type NoCoolDown

type NoCoolDown struct{}

func (*NoCoolDown) GetNextWaitTime

func (c *NoCoolDown) GetNextWaitTime() time.Duration

func (*NoCoolDown) Reset

func (c *NoCoolDown) Reset()

type ProtonClientRetryWrapper

type ProtonClientRetryWrapper[T any] struct {
	// contains filtered or unexported fields
}

func NewClientRetryWrapper

func NewClientRetryWrapper[T any](client T, coolDown CoolDownProvider) *ProtonClientRetryWrapper[T]

func (*ProtonClientRetryWrapper[T]) DidEncounter429or5xx

func (p *ProtonClientRetryWrapper[T]) DidEncounter429or5xx() bool

func (*ProtonClientRetryWrapper[T]) Retry

func (p *ProtonClientRetryWrapper[T]) Retry(ctx context.Context, f func(context.Context, T) error) error

Jump to

Keyboard shortcuts

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