ratelimiter

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimiter

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

func NewRateLimiter

func NewRateLimiter(
	interval time.Duration,
	capacity int64,
	getRateKey func(c *gin.Context) (string, error),
	onLimitReached func(c *gin.Context, key string),
) RateLimiter

func (*RateLimiter) LimitRate

func (rl *RateLimiter) LimitRate() gin.HandlerFunc

Jump to

Keyboard shortcuts

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