Documentation ¶
Overview ¶
Package request defines and implements Limiter and Tagger for throttling [http.Request]s.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextTagger ¶
ContextTagger is used together with NewRequestTaggerFromContextTagger to tag requests based on context values. This can help with rate-limiting requests by a role.
type Limiter ¶
type Tagger ¶
Tagger associates tags to [http.Request]s in order to group related requests for a discriminating rate limiter. Requests with the same association tag will be tracked together by the Limiter.
func NewRequestTaggerFromContextTagger ¶
func NewRequestTaggerFromContextTagger(t ContextTagger) Tagger
NewRequestTaggerFromContextTagger adapts a ContextTagger to a Tagger.
Directories ¶
Path | Synopsis |
---|---|
Package tagbycontext implements [request.Limiter] by extracting values from request context.Context.
|
Package tagbycontext implements [request.Limiter] by extracting values from request context.Context. |
Package tagbycookie implements [request.Limiter] by extracting an HTTP cookie from [http.Request]s.
|
Package tagbycookie implements [request.Limiter] by extracting an HTTP cookie from [http.Request]s. |
Package tagbyheader implements [request.Limiter] by extracting an HTTP header value from [http.Request]s.
|
Package tagbyheader implements [request.Limiter] by extracting an HTTP header value from [http.Request]s. |
Package tagbyip implements [request.Limiter] by extracting Internet Protocol addresses from [http.Request]s.
|
Package tagbyip implements [request.Limiter] by extracting Internet Protocol addresses from [http.Request]s. |
Click to show internal directories.
Click to hide internal directories.