Documentation ¶
Index ¶
- type RateLimit
- func (RateLimit) CaddyModule() caddy.ModuleInfo
- func (rl *RateLimit) Cleanup() error
- func (rl *RateLimit) Provision(ctx caddy.Context) (err error)
- func (rl *RateLimit) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (rl *RateLimit) UnmarshalCaddyfile(d *caddyfile.Dispenser) (err error)
- func (rl *RateLimit) Validate() error
- type Zone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimit ¶
type RateLimit struct { Key string `json:"key,omitempty"` Rate string `json:"rate,omitempty"` ZoneSize int `json:"zone_size,omitempty"` RejectStatusCode int `json:"reject_status,omitempty"` // contains filtered or unexported fields }
RateLimit implements a handler for rate-limiting.
func (RateLimit) CaddyModule ¶
func (RateLimit) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*RateLimit) ServeHTTP ¶
func (rl *RateLimit) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
ServeHTTP implements caddyhttp.MiddlewareHandler.
func (*RateLimit) UnmarshalCaddyfile ¶
Click to show internal directories.
Click to hide internal directories.