Documentation
¶
Index ¶
- type BrowserCacheMiddlewareConfig
- type Middleware
- func (m *Middleware) InjectReqctx(next echo.HandlerFunc) echo.HandlerFunc
- func (Middleware) NewBrowserCacheMiddleware(config BrowserCacheMiddlewareConfig) echo.MiddlewareFunc
- func (Middleware) RateLimit(config RateLimitConfig) echo.MiddlewareFunc
- func (m *Middleware) RequireAuth(next echo.HandlerFunc) echo.HandlerFunc
- func (m *Middleware) RequireNoAuth(next echo.HandlerFunc) echo.HandlerFunc
- type RateLimitConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
func New ¶
func New(servs *service.Service) *Middleware
func (*Middleware) InjectReqctx ¶
func (m *Middleware) InjectReqctx(next echo.HandlerFunc) echo.HandlerFunc
func (Middleware) NewBrowserCacheMiddleware ¶
func (Middleware) NewBrowserCacheMiddleware( config BrowserCacheMiddlewareConfig, ) echo.MiddlewareFunc
NewBrowserCacheMiddleware creates a new CacheMiddleware with the specified cache duration and a list of excluded files that will bypass the cache.
func (Middleware) RateLimit ¶
func (Middleware) RateLimit(config RateLimitConfig) echo.MiddlewareFunc
RateLimit creates a rate limiting middleware.
func (*Middleware) RequireAuth ¶
func (m *Middleware) RequireAuth(next echo.HandlerFunc) echo.HandlerFunc
func (*Middleware) RequireNoAuth ¶
func (m *Middleware) RequireNoAuth(next echo.HandlerFunc) echo.HandlerFunc
type RateLimitConfig ¶
type RateLimitConfig struct {
// Limit is the maximum number of requests to allow per period.
Limit int
// Period is the duration in which the limit is enforced.
Period time.Duration
}
RateLimitConfig defines the config for RateLimit middleware.
Click to show internal directories.
Click to hide internal directories.