ratelimit

package
v0.0.0-...-b7bf783 Latest Latest
Warning

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

Go to latest
Published: May 18, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

func NewParser() parser.IngressAnnotation

NewParser creates a new ratelimit annotation parser

Types

type RateLimit

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

RateLimit returns rate limit configuration for an Ingress rule limiting the number of connections per IP address and/or connections per second. If you both annotations are specified in a single Ingress rule, RPS limits takes precedence

type Zone

type Zone struct {
	Name  string `json:"name"`
	Limit int    `json:"limit"`
	Burst int    `json:"burst"`
	// SharedSize amount of shared memory for the zone
	SharedSize int `json:"sharedSize"`
}

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