Documentation ¶
Index ¶
Constants ¶
View Source
const ( QPSStrategy = "QPS" RateLimiterStrategy = "RateLimiter" )
limit strategy
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LimitEngine ¶
type LimitEngine struct { RuleConfig *model.RuleConfig // contains filtered or unexported fields }
LimitEngine limit
func NewLimitEngine ¶
func NewLimitEngine(ruleConfig *model.RuleConfig) (*LimitEngine, error)
NewLimitEngine limit
type QPSLimiter ¶
type QPSLimiter struct {
// contains filtered or unexported fields
}
QPSLimiter limiter
func NewQPSLimiter ¶
func NewQPSLimiter(maxAllows int64, periodMs int64) (*QPSLimiter, error)
NewQPSLimiter new
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter limit
func NewRateLimiter ¶
func NewRateLimiter(maxAllows int64, periodMs int64, MaxBurstRatio float64) (*RateLimiter, error)
NewRateLimiter new
Click to show internal directories.
Click to hide internal directories.