l4throttle

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

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) Handle

func (h Handler) Handle(cx *layer4.Connection, next layer4.Handler) error

Handle handles the connection.

func (*Handler) Provision

func (h *Handler) Provision(ctx caddy.Context) error

Provision sets up the handler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL