Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrLimitExceed is returned when the rate limiter is // triggered and the request is rejected due to limit exceeded. ErrLimitExceed = errors.New("rate limit exceeded") )
Functions ¶
This section is empty.
Types ¶
type Ratelimit ¶
type Ratelimit struct {
// contains filtered or unexported fields
}
Ratelimit implements bbr-like limiter. It is inspired by sentinel. https://github.com/alibaba/Sentinel/wiki/%E7%B3%BB%E7%BB%9F%E8%87%AA%E9%80%82%E5%BA%94%E9%99%90%E6%B5%81
func NewLimiter ¶
NewLimiter returns a bbr limiter
Click to show internal directories.
Click to hide internal directories.