ratelimiter

package
v1.2.27 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(ctx context.Context, limiter *redis_rate.Limiter, limit redis_rate.Limit, key string) bool

func IsRunnable

func IsRunnable(c *gin.Context, resource string) bool

It has to be used along with Postware middlewares only

func PostwareLimitUser added in v1.2.4

func PostwareLimitUser(limiter *redis_rate.Limiter, limit redis_rate.Limit) gin.HandlerFunc

This has to be put after actual handler, since it requires input from actual handler. The control is passed using c.Next(), which on limit reach inform in c.c.IsAborted()

func PrewareLimitUser added in v1.2.4

func PrewareLimitUser(limiter *redis_rate.Limiter, limit redis_rate.Limit) gin.HandlerFunc

This has to be put before actual handler, since it doesn't require any input from actual handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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