Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorLimitHandler(logger multilog.Logger, c Client, err error, now time.Time)
- func ErrorThrottleHandler(logger multilog.Logger, c Client, err error, now time.Time)
- func LimitHandler(logger multilog.Logger, c Client, now time.Time)
- func ThrottleHandler(logger multilog.Logger, c Client, now time.Time)
- type Client
- type CommonConfig
Constants ¶
View Source
const ( DefaultRetryAfter = "3" DefaultWaiting = 3 * time.Second )
View Source
const (
// HeaderRateLimitRemaining = "X-RateLimit-Remaining"
HeaderRetryAfter = "Retry-After"
)
Variables ¶
View Source
var ( ErrGetCPUUtilizationFail = errors.New("get CPU utilization fails") ErrGetRAMUsedFail = errors.New("get RAM used fails") ErrClosedResourcer = errors.New("the resourcer is closed") ErrResourcerNoResult = errors.New("resourcer fails with no result") )
View Source
var DefaultCommonConfig = CommonConfig{ MemoryUsageBarrierPercentage: rate.DefaultMemoryUsageBarrierPercentage, CPUUtilizationBarrierPercentage: rate.DefaultCPUUtilizationBarrierPercentage, Debug: false, }
Functions ¶
func ErrorLimitHandler ¶ added in v0.1.4
func ErrorThrottleHandler ¶ added in v0.1.4
func LimitHandler ¶ added in v0.1.4
Types ¶
type CommonConfig ¶ added in v0.1.2
type CommonConfig struct { // MemoryUsageBarrierPercentage the memory usage barrier after which the rate is enabled MemoryUsageBarrierPercentage float64 // CPUUtilizationBarrierPercentage the CPU utilization barrier after which the rate is enabled CPUUtilizationBarrierPercentage float64 // может быть nil Logger multilog.Logger Debug bool }
Click to show internal directories.
Click to hide internal directories.