Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlackHouseT ¶
func NewBlackHouseT ¶
func NewBlackHouseT() *BlackHouseT
func (*BlackHouseT) AddBlack ¶
func (b *BlackHouseT) AddBlack(ipInt uint32, blackDuration time.Duration)
func (*BlackHouseT) IsBlack ¶
func (b *BlackHouseT) IsBlack(ipInt uint32) (ok bool)
func (*BlackHouseT) List ¶
func (b *BlackHouseT) List() (ipList []string)
type IPRateLimiterT ¶
func NewIPRateLimiter ¶
func NewIPRateLimiter(rateSpeed int, bucketLen int, blackTimes int, intervalSecond int) *IPRateLimiterT
func (*IPRateLimiterT) BlackAllow ¶
func (i *IPRateLimiterT) BlackAllow(ipInt uint32) bool
func (*IPRateLimiterT) IPAllow ¶
func (i *IPRateLimiterT) IPAllow(ipInt uint32) bool
func (*IPRateLimiterT) Len ¶
func (i *IPRateLimiterT) Len() int
type WhiteIPT ¶
func NewWhiteIPT ¶
func NewWhiteIPT() *WhiteIPT
Click to show internal directories.
Click to hide internal directories.