Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimitMiddleware ¶
type RateLimitMiddleware struct {
// contains filtered or unexported fields
}
RateLimitMiddleware contains the data required to implement per endpoint rate limiting using a catalog of valid api keys.
For unknow endpoints we can choose if we let them pass or if we deny the access
func NewRateLimitMiddleware ¶
func NewRateLimitMiddleware(next http.Handler, apiKeyHeader string, apiKeyCatalog catalog.APIKeys, redisPool *redis.Pool, matcher pathmatcher.Matcher) *RateLimitMiddleware
NewRateLimitMiddleware creates a new RateLimitMiddleware
func (*RateLimitMiddleware) ServeHTTP ¶
func (rlm *RateLimitMiddleware) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP https://tools.ietf.org/id/draft-polli-ratelimit-headers-00.html
Click to show internal directories.
Click to hide internal directories.