Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMaliciousResponse = errors.New("malicious response")
Functions ¶
func IsErrorRetryable ¶
func IsStatusCodeRetryable ¶
Types ¶
type Retrier ¶
type Retrier interface { // Retry 判断是否重试,如何重试 Retry(*http.Response, error, *RetrierOptions) RetryDecision }
Retrier 重试器接口
func NewRetrier ¶
func NewRetrier(fn func(*http.Response, error, *RetrierOptions) RetryDecision) Retrier
NewRetrier 创建自定义重试器
type RetryDecision ¶
type RetryDecision int
RetryDecision 重试决策
const ( // 不再重试 DontRetry RetryDecision = iota // 重试下一个域名 TryNextHost // 重试当前域名 RetryRequest )
Click to show internal directories.
Click to hide internal directories.