Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRetryQuotaExceeded = errors.New("fast_retry:retry quota exceeded")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { FastRetryTime time.Duration // 默认 2s,建议设置成当前 API 的 PCT99 MaxRetryRate float64 // 最大重试百分比,0.05 代表 5%,默认 5%,超出返回 ErrRetryQuotaExceeded RetryCnt int // 最多发送的请求次数,默认 3 次,最少两次,其中一次是快速重试 RetryWaitTime time.Duration // 重试间隔,默认是 FastRetryTime / 10 Clock Clock // 模拟时钟,mock 用 MaxRetryCapacity int // 平时没有超时的时候,允许积攒的重启请求最大数目,默认 1000 个 RetryIf func(err error) bool // 出错的时候调用,判断是否对 error 进行重试,默认值 err != nil }
Click to show internal directories.
Click to hide internal directories.