Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// The number of bytes to read per second, per connection.
ReadBytesPerSecond float64 `json:"read_bytes_per_second,omitempty"`
// The maximum number of bytes to read at once (rate permitting) per connection.
// If a rate is specified, burst must be greater than zero; default is same as
// the rate (truncated to integer).
ReadBurstSize int `json:"read_burst_size,omitempty"`
// The number of bytes to read per second, across all connections ("per handler").
TotalReadBytesPerSecond float64 `json:"total_read_bytes_per_second,omitempty"`
// The maximum number of bytes to read at once (rate permitting) across all
// connections ("per handler"). If a rate is specified, burst must be greater
// than zero; default is same as the rate (truncated to integer).
TotalReadBurstSize int `json:"total_read_burst_size,omitempty"`
// Delay before initial read on each connection.
Latency caddy.Duration `json:"latency,omitempty"`
// contains filtered or unexported fields
}
Handler throttles connections using leaky bucket rate limiting.
func (*Handler) CaddyModule ¶
func (*Handler) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*Handler) UnmarshalCaddyfile ¶
UnmarshalCaddyfile sets up the Handler from Caddyfile tokens. Syntax:
throttle {
latency <duration>
read_burst_size <int>
read_bytes_per_second <float>
total_read_burst_size <int>
total_read_bytes_per_second <float>
}
Click to show internal directories.
Click to hide internal directories.