Documentation ¶
Index ¶
- Variables
- func IPTokenExtractor(c *gin.Context) string
- func NewRateLimiterMw(next sgin.HandlerFactory) sgin.HandlerFactory
- type EndpointMw
- func NewEndpointRateLimiterMw(tb juju.Limiter) EndpointMw
- func NewHeaderLimiterMw(header string, maxRate float64, capacity int64) EndpointMw
- func NewIpLimiterMw(maxRate float64, capacity int64) EndpointMw
- func NewIpLimiterWithKeyMw(header string, maxRate float64, capacity int64) EndpointMw
- func NewTokenLimiterMw(tokenExtractor TokenExtractor, limiterStore srate.LimiterStore) EndpointMw
- type TokenExtractor
Constants ¶
This section is empty.
Variables ¶
View Source
var HandlerFactory = NewRateLimiterMw(sgin.EndpointHandler)
Functions ¶
func IPTokenExtractor ¶
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 ¶
func HeaderTokenExtractor ¶
func HeaderTokenExtractor(header string) TokenExtractor
func NewIPTokenExtractor ¶
func NewIPTokenExtractor(header string) TokenExtractor
Click to show internal directories.
Click to hide internal directories.