Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheMiddleware ¶
type CacheMiddleware struct {
// contains filtered or unexported fields
}
func NewCacheMiddleware ¶
func NewCacheMiddleware(expiration time.Duration, keyPrefix string) *CacheMiddleware
func (*CacheMiddleware) Apply ¶
func (cm *CacheMiddleware) Apply(next AppHandler) AppHandler
type IPFilterMiddleware ¶
type IPFilterMiddleware struct {
AllowedIPs []string
}
func (IPFilterMiddleware) Apply ¶
func (ipm IPFilterMiddleware) Apply(next AppHandler) AppHandler
type LoggingMiddleware ¶
type LoggingMiddleware struct{}
func (LoggingMiddleware) Apply ¶
func (LoggingMiddleware) Apply(next AppHandler) AppHandler
type Middleware ¶
type Middleware interface {
Apply(AppHandler) AppHandler
}
func NewCORSMiddleware ¶
func NewCORSMiddleware(allowedOrigins, allowedMethods, allowedHeaders []string) Middleware
Creates a new CORS middleware that allows requests from any origin (using the * character) and with the specified HTTP methods and headers.
type RateLimiterMiddleware ¶
type RateLimiterMiddleware struct {
// contains filtered or unexported fields
}
func NewRateLimiterMiddleware ¶
func NewRateLimiterMiddleware(maxRequests int, interval time.Duration) *RateLimiterMiddleware
Create in-memory rate limiter The limiter is limiting IP to make more then maxRequests in the interval duration.
func (*RateLimiterMiddleware) Apply ¶
func (rlm *RateLimiterMiddleware) Apply(next AppHandler) AppHandler
type TimeoutMiddleware ¶
func (TimeoutMiddleware) Apply ¶
func (tm TimeoutMiddleware) Apply(next AppHandler) AppHandler
type TimingMiddleware ¶
type TimingMiddleware struct{}
func (TimingMiddleware) Apply ¶
func (TimingMiddleware) Apply(next AppHandler) AppHandler
Click to show internal directories.
Click to hide internal directories.