ratelimiter

package
v0.0.0-...-d814896 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRateLimitConfig = RateLimitConfig{
	Skipper: middleware.DefaultSkipper,
	Limit:   3,
}

DefaultRateLimitConfig defines the default limiter config

Functions

func RateLimitMiddleware

func RateLimitMiddleware() echo.MiddlewareFunc

RateLimitMiddleware returns a middleware for echo with default config

func RateLimitWithConfig

func RateLimitWithConfig(config RateLimitConfig) echo.MiddlewareFunc

RateLimitWithConfig returns a middleware for echo with config

Types

type RateLimitConfig

type RateLimitConfig struct {
	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper
	Limit   float64
}

RateLimitConfig defines the rate limiter config

Jump to

Keyboard shortcuts

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