1
0
Fork 0

chore: move the parser to a dedicated package.

This commit is contained in:
Ludovic Fernandez 2020-08-17 18:04:03 +02:00 committed by GitHub
parent eecc2f4dd7
commit 1502d20def
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 191 additions and 14278 deletions

View file

@ -9,7 +9,7 @@ import (
"time"
"github.com/containous/traefik/v2/pkg/ip"
"github.com/containous/traefik/v2/pkg/types"
ptypes "github.com/traefik/paerser/types"
)
// +k8s:deepcopy-gen=true
@ -319,7 +319,7 @@ type RateLimit struct {
// Period, in combination with Average, defines the actual maximum rate, such as:
// r = Average / Period. It defaults to a second.
Period types.Duration `json:"period,omitempty" toml:"period,omitempty" yaml:"period,omitempty"`
Period ptypes.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.
@ -331,7 +331,7 @@ type RateLimit struct {
// SetDefaults sets the default values on a RateLimit.
func (r *RateLimit) SetDefaults() {
r.Burst = 1
r.Period = types.Duration(time.Second)
r.Period = ptypes.Duration(time.Second)
}
// +k8s:deepcopy-gen=true