ratelimiter

package
v1.6.0-preview.4 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v0.1.10

func Init()

Types

type HandleT

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

HandleT is a Handle for event limiter

func (*HandleT) LimitReached

func (rateLimiter *HandleT) LimitReached(key string) bool

LimitReached returns true if number of events in the rolling window is less than the max events allowed, else false

func (*HandleT) SetUp

func (rateLimiter *HandleT) SetUp()

SetUp eventLimiter

type RateLimiter added in v0.1.10

type RateLimiter interface {
	LimitReached(key string) bool
}

RateLimiter is an interface for rate limiting functions

Jump to

Keyboard shortcuts

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