Documentation
¶
Index ¶
- func DefaultRetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error)
- func ErrorPropagatedRetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error)
- func ManyRequests(r *http.Response, header string) (time.Duration, bool)
- type Backoff
- type CheckRetry
- type Client
- type Option
- func WithBackoff(backoff Backoff) Option
- func WithCheckRetry(checkRetry CheckRetry) Option
- func WithInnerClient(inner Client) Option
- func WithLogger(logger *slog.Logger) Option
- func WithRetryMax(m int) Option
- func WithRetryWaitMax(m time.Duration) Option
- func WithRetryWaitMin(m time.Duration) Option
- type RLClient
- type RetryClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRetryPolicy ¶
func ErrorPropagatedRetryPolicy ¶
ErrorPropagatedRetryPolicy is the same as DefaultRetryPolicy, except it propagates errors back instead of returning nil. This allows you to inspect why it decided to retry or not.
Types ¶
type Backoff ¶
func DefaultBackoff ¶
type CheckRetry ¶
type Option ¶
type Option func(client *RetryClient)
func WithBackoff ¶
func WithCheckRetry ¶
func WithCheckRetry(checkRetry CheckRetry) Option
func WithInnerClient ¶
func WithLogger ¶
func WithRetryMax ¶
func WithRetryWaitMax ¶
func WithRetryWaitMin ¶
type RLClient ¶
type RLClient struct {
// contains filtered or unexported fields
}
func (*RLClient) CloseIdleConnections ¶
func (c *RLClient) CloseIdleConnections()
type RetryClient ¶
type RetryClient struct {
// contains filtered or unexported fields
}
func NewRetryClient ¶
func NewRetryClient(options ...Option) *RetryClient
func (*RetryClient) CloseIdleConnections ¶
func (c *RetryClient) CloseIdleConnections()
Click to show internal directories.
Click to hide internal directories.