middleware

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: GPL-3.0 Imports: 15 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMaxNumRequests = errors.New("max number of requests value is invalid")

ErrInvalidMaxNumRequests signals that a provided number of requests is invalid

View Source
var ErrTooManyRequests = errors.New("too many requests")

ErrTooManyRequests signals that too many requests were simultaneously received

Functions

func CreateEndpointThrottlerFromFacade

func CreateEndpointThrottlerFromFacade(throttlerName string, facade interface{}) gin.HandlerFunc

CreateEndpointThrottlerFromFacade will create a middleware-type of handler to be used in conjunction with special REST API end points that need to be better protected

func NewGlobalThrottler

func NewGlobalThrottler(maxConnections uint32) (*globalThrottler, error)

NewGlobalThrottler creates a new instance of a globalThrottler

func NewResponseLoggerMiddleware

func NewResponseLoggerMiddleware(thresholdDurationForLoggingRequest time.Duration) *responseLoggerMiddleware

NewResponseLoggerMiddleware returns a new instance of responseLoggerMiddleware

func NewSourceThrottler

func NewSourceThrottler(maxNumRequests uint32) (*sourceThrottler, error)

NewSourceThrottler creates a new instance of a sourceThrottler

Types

This section is empty.

Jump to

Keyboard shortcuts

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