ratelimit

package
v0.9.201 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package ratelimit provides filters to control the rate limitter settings on the route level.

For detailed documentation of the ratelimit, see https://godoc.org/github.com/zalando/skipper/ratelimit.

Index

Constants

View Source
const RouteSettingsKey = "#ratelimitsettings"

RouteSettingsKey is used as key in the context state bag

Variables

This section is empty.

Functions

func NewDisableRatelimit

func NewDisableRatelimit() filters.Spec

NewDisableRatelimit disables rate limiting

Example:

backendHealthcheck: Path("/healthcheck")
-> disableRatelimit()
-> "https://foo.backend.net";

func NewLocalRatelimit

func NewLocalRatelimit() filters.Spec

NewLocalRatelimit creates a local measured rate limiting, that is only aware of itself. If you have 5 instances with 20 req/s, then it would allow 100 req/s to the backend from the same user. A third argument can be used to set which part of the request should be used to find the same user. Third argument defaults to XForwardedForLookuper, meaning X-Forwarded-For Header.

Example:

backendHealthcheck: Path("/healthcheck")
-> localRatelimit(20, "1m")
-> "https://foo.backend.net";

Example rate limit per Authorization Header:

login: Path("/login")
-> localRatelimit(3, "1m", "auth")
-> "https://login.backend.net";

func NewRatelimit added in v0.9.115

func NewRatelimit() filters.Spec

NewRatelimit creates a service rate limiting, that is only aware of itself. If you have 5 instances with 20 req/s, then it would at max allow 100 req/s to the backend.

Example:

backendHealthcheck: Path("/healthcheck")
-> ratelimit(20, "1s")
-> "https://foo.backend.net";

Types

This section is empty.

Jump to

Keyboard shortcuts

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