From ee06778cc2a32b157956b5132dda27c878dda089 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 23 Mar 2020 13:08:04 +0100 Subject: [PATCH] fix: period field name. --- pkg/config/dynamic/middlewares.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/config/dynamic/middlewares.go b/pkg/config/dynamic/middlewares.go index e01480e97..85c93d1f3 100644 --- a/pkg/config/dynamic/middlewares.go +++ b/pkg/config/dynamic/middlewares.go @@ -321,12 +321,15 @@ type RateLimit struct { // The rate is actually defined by dividing Average by Period. So for a rate below 1req/s, // one needs to define a Period larger than a second. Average int64 `json:"average,omitempty" toml:"average,omitempty" yaml:"average,omitempty"` + // Period, in combination with Average, defines the actual maximum rate, such as: // r = Average / Period. It defaults to a second. - Period types.Duration + Period types.Duration `json:"period,omitempty" toml:"period,omitempty" yaml:"period,omitempty"` + // Burst is the maximum number of requests allowed to arrive in the same arbitrarily small period of time. // It defaults to 1. - Burst int64 `json:"burst,omitempty" toml:"burst,omitempty" yaml:"burst,omitempty"` + Burst int64 `json:"burst,omitempty" toml:"burst,omitempty" yaml:"burst,omitempty"` + SourceCriterion *SourceCriterion `json:"sourceCriterion,omitempty" toml:"sourceCriterion,omitempty" yaml:"sourceCriterion,omitempty"` }