ratelimit

package
v0.0.0-...-1701bfc Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

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"`

	RPM Zone `json:"rpm"`

	LimitRate int `json:"limit-rate"`

	LimitRateAfter int `json:"limit-rate-after"`

	Name string `json:"name"`

	ID string `json:"id"`

	Whitelist []string `json:"whitelist"`
}

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

func (*RateLimit) Equal

func (rt1 *RateLimit) Equal(rt2 *RateLimit) bool

Equal tests for equality between two RateLimit types

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

func (*Zone) Equal

func (z1 *Zone) Equal(z2 *Zone) bool

Equal tests for equality between two Zone types

Jump to

Keyboard shortcuts

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