Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LimiterConfig ¶
func NewLimiterConfig ¶
func NewLimiterConfig(rate int) LimiterConfig
NewLimiterConfig create default limiter configuration.
type ReqLimiter ¶
type ReqLimiter struct {
// contains filtered or unexported fields
}
func NewReqLimiter ¶
func NewReqLimiter(cfg LimiterConfig) *ReqLimiter
NewReqLimiter create new instance of ReqLimiter.
func (*ReqLimiter) Allow ¶
func (r *ReqLimiter) Allow(key string) bool
Allow check allow or not action by limits.
func (*ReqLimiter) HasKey ¶
func (r *ReqLimiter) HasKey(key string) bool
Click to show internal directories.
Click to hide internal directories.