addrquota

package
v0.25.5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quota

type Quota struct {
	// contains filtered or unexported fields
}

Quota implements a simple IP-based rate limiter. Each set of incoming IP addresses with the same low-order byte gets events per second. Information is kept in an LRU cache of size maxEntries.

func NewQuota

func NewQuota(eventsPerSecond float32, burst, maxEntries int) *Quota

func (*Quota) Blocked

func (q *Quota) Blocked(ip string) bool

Jump to

Keyboard shortcuts

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