Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CORS = func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { c.Response().Header().Set("Access-Control-Allow-Origin", "*") return next(c) } }
View Source
var CustomRateLimiterConfig = middleware.RateLimiterConfig{ Skipper: middleware.DefaultSkipper, Store: middleware.NewRateLimiterMemoryStoreWithConfig( middleware.RateLimiterMemoryStoreConfig{Rate: 50, Burst: 100, ExpiresIn: 3 * time.Minute}, ), IdentifierExtractor: func(ctx echo.Context) (string, error) { id := ctx.RealIP() return id, nil }, ErrorHandler: func(context echo.Context, err error) error { return context.JSON(http.StatusForbidden, nil) }, DenyHandler: func(context echo.Context, identifier string, err error) error { return context.JSON(http.StatusTooManyRequests, nil) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.