ratelimit

package
v0.0.0-...-336e61a Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidRateLimit is returned when the annotation caontains invalid values
	ErrInvalidRateLimit = errors.New("invalid rate limit value. Must be > 0")
)

Functions

This section is empty.

Types

type RateLimit

type RateLimit struct {
	// Connections indicates a limit with the number of connections per IP address
	Connections Zone
	// RPS indicates a limit with the number of connections per second
	RPS Zone
}

RateLimit returns rate limit configuration for an Ingress rule Is possible to limit the number of connections per IP address or connections per second. Note: Is possible to specify both limits

func ParseAnnotations

func ParseAnnotations(ing *extensions.Ingress) (*RateLimit, error)

ParseAnnotations parses the annotations contained in the ingress rule used to rewrite the defined paths

type Zone

type Zone struct {
	Name  string
	Limit int
	Burst int
	// SharedSize amount of shared memory for the zone
	SharedSize int
}

Zone returns information about the NGINX rate limit (limit_req_zone) http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req_zone

Jump to

Keyboard shortcuts

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