ipratelimit

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPRateLimiterT

type IPRateLimiterT struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewIPRateLimiter

func NewIPRateLimiter(rateSpeed int, bucketLen int, blackTimes int, intervalSecond int) *IPRateLimiterT

func (*IPRateLimiterT) BlackAllow

func (i *IPRateLimiterT) BlackAllow(ipInt typ.IPInt) bool

func (*IPRateLimiterT) IPAllow

func (i *IPRateLimiterT) IPAllow(ipInt typ.IPInt) bool

func (*IPRateLimiterT) Len

func (i *IPRateLimiterT) Len() int

func (*IPRateLimiterT) SetParam

func (i *IPRateLimiterT) SetParam(rateSpeed int, bucketLen int, blackTimes int, intervalSecond int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL