ratelimiter

package
v0.0.0-...-0ade494 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

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

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