Documentation ¶
Index ¶
- Constants
- type Policy
- type RateLimiter
- func (rl *RateLimiter) Close()
- func (rl *RateLimiter) DefaultSpec() interface{}
- func (rl *RateLimiter) Description() string
- func (rl *RateLimiter) Handle(ctx context.HTTPContext) string
- func (rl *RateLimiter) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)
- func (rl *RateLimiter) Init(filterSpec *httppipeline.FilterSpec)
- func (rl *RateLimiter) Kind() string
- func (rl *RateLimiter) Results() []string
- func (rl *RateLimiter) Status() interface{}
- type Spec
- type URLRule
Constants ¶
View Source
const (
// Kind is the kind of RateLimiter.
Kind = "RateLimiter"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy struct { Name string `yaml:"name" jsonschema:"required"` TimeoutDuration string `yaml:"timeoutDuration" jsonschema:"omitempty,format=duration"` LimitRefreshPeriod string `yaml:"limitRefreshPeriod" jsonschema:"omitempty,format=duration"` LimitForPeriod int `yaml:"limitForPeriod" jsonschema:"omitempty,minimum=1"` }
Policy defines the policy of a rate limiter
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter defines the rate limiter
func (*RateLimiter) DefaultSpec ¶
func (rl *RateLimiter) DefaultSpec() interface{}
DefaultSpec returns the default spec of RateLimiter.
func (*RateLimiter) Description ¶
func (rl *RateLimiter) Description() string
Description returns the description of RateLimiter
func (*RateLimiter) Handle ¶
func (rl *RateLimiter) Handle(ctx context.HTTPContext) string
Handle handles HTTP request
func (*RateLimiter) Inherit ¶
func (rl *RateLimiter) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)
Inherit inherits previous generation of RateLimiter.
func (*RateLimiter) Init ¶
func (rl *RateLimiter) Init(filterSpec *httppipeline.FilterSpec)
Init initializes RateLimiter.
func (*RateLimiter) Kind ¶
func (rl *RateLimiter) Kind() string
Kind returns the kind of RateLimiter.
func (*RateLimiter) Results ¶
func (rl *RateLimiter) Results() []string
Results returns the results of RateLimiter.
func (*RateLimiter) Status ¶
func (rl *RateLimiter) Status() interface{}
Status returns Status generated by Runtime.
Click to show internal directories.
Click to hide internal directories.