ratelimiter

package
v0.0.0-...-f94be1b Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Limit

func Limit() middleware.Middleware

Limit middleware limits the requests made to elasticsearch for each permission.

Types

type Ratelimiter

type Ratelimiter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Ratelimiter limits the number of requests made by a permission per category as well as per IP. Creating direct instances of RateLimiter should be avoided. ratelimiter.Instance returns the singleton instance of the Ratelimiter.

func Instance

func Instance() *Ratelimiter

Instance returns the singleton instance of ratelimiter.

Jump to

Keyboard shortcuts

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