gin

package
v0.0.0-...-9823ec8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func IPTokenExtractor

func IPTokenExtractor(c *gin.Context) string

func NewRateLimiterMw

func NewRateLimiterMw(next sgin.HandlerFactory) sgin.HandlerFactory

Types

type EndpointMw

type EndpointMw func(gin.HandlerFunc) gin.HandlerFunc

func NewEndpointRateLimiterMw

func NewEndpointRateLimiterMw(tb juju.Limiter) EndpointMw

func NewHeaderLimiterMw

func NewHeaderLimiterMw(header string, maxRate float64, capacity int64) EndpointMw

func NewIpLimiterMw

func NewIpLimiterMw(maxRate float64, capacity int64) EndpointMw

func NewIpLimiterWithKeyMw

func NewIpLimiterWithKeyMw(header string, maxRate float64, capacity int64) EndpointMw

func NewTokenLimiterMw

func NewTokenLimiterMw(tokenExtractor TokenExtractor, limiterStore srate.LimiterStore) EndpointMw

type TokenExtractor

type TokenExtractor func(*gin.Context) string

func HeaderTokenExtractor

func HeaderTokenExtractor(header string) TokenExtractor

func NewIPTokenExtractor

func NewIPTokenExtractor(header string) TokenExtractor

Jump to

Keyboard shortcuts

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