Documentation
¶
Overview ¶
请求阻拦器 可用于限制用户的每秒最大请求数等场景 by:liangliangit
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestBlock ¶
type RequestBlocker ¶
type RequestBlocker struct {
sync.Mutex
ResetTimeleft int64 //CD冷却锁定时间
BlockCountLimit int64 //请求锁定阀值
// contains filtered or unexported fields
}
func New ¶
func New(ResetTimeleft, BlockCountLimit int64) *RequestBlocker
func (*RequestBlocker) Request ¶
func (l *RequestBlocker) Request(feature string) bool
Click to show internal directories.
Click to hide internal directories.