Documentation ¶
Index ¶
- func BuildKeys(limiter *config.Limiter, r engine.Request) [][]string
- func LimitByRequest(limiter *config.Limiter, r engine.Request) *errors.HTTPError
- func LimitHandler(limiter *config.Limiter) echo.MiddlewareFunc
- func LimitMiddleware(limiter *config.Limiter) echo.MiddlewareFunc
- func RemoteIP(ipLookups []string, r engine.Request) string
- func StringInSlice(sliceString []string, needle string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKeys ¶
BuildKeys generates a slice of keys to rate-limit by given config and request structs.
func LimitByRequest ¶
LimitByRequest builds keys based on http.Request struct, loops through all the keys, and check if any one of them returns HTTPError.
func LimitHandler ¶
func LimitHandler(limiter *config.Limiter) echo.MiddlewareFunc
func LimitMiddleware ¶
func LimitMiddleware(limiter *config.Limiter) echo.MiddlewareFunc
func StringInSlice ¶
StringInSlice finds needle in a slice of strings.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.