Documentation ¶
Index ¶
- Constants
- func NewContextLimitFilter(c *config.Config) (pipeline.Filter, error)
- func NewDropFilter(c *config.Config) (pipeline.Filter, error)
- func NewElasticsearchBulkRequestThrottleFilter(c *config.Config) (pipeline.Filter, error)
- func NewHealthCheckFilter(c *config.Config) (pipeline.Filter, error)
- func NewRequestAPIKeyLimitFilter(c *config.Config) (pipeline.Filter, error)
- func NewRequestClientIPLimitFilter(c *config.Config) (pipeline.Filter, error)
- func NewRequestHostLimitFilter(c *config.Config) (pipeline.Filter, error)
- func NewRequestPathLimitFilter(c *config.Config) (pipeline.Filter, error)
- func NewRequestUserLimitFilter(c *config.Config) (pipeline.Filter, error)
- func NewRetryLimiter(c *config.Config) (pipeline.Filter, error)
- func NewSleepFilter(c *config.Config) (pipeline.Filter, error)
- type ContextLimitFilter
- type DropFilter
- type ElasticsearchBulkRequestThrottle
- type ElasticsearchHealthCheckFilter
- type GenericLimiter
- type MatchRules
- type RequestAPIKeyLimitFilter
- type RequestClientIPLimitFilter
- type RequestHostLimitFilter
- type RequestPathLimitFilter
- type RequestUserLimitFilter
- type RetryLimiter
- type SleepFilter
Constants ¶
View Source
const RetryKey = "Retried_times"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextLimitFilter ¶
type ContextLimitFilter struct { Context []string `config:"context"` // contains filtered or unexported fields }
func (*ContextLimitFilter) Filter ¶
func (filter *ContextLimitFilter) Filter(ctx *fasthttp.RequestCtx)
func (*ContextLimitFilter) Name ¶
func (filter *ContextLimitFilter) Name() string
type DropFilter ¶
type DropFilter struct {
param.Parameters
}
func (*DropFilter) Filter ¶
func (filter *DropFilter) Filter(ctx *fasthttp.RequestCtx)
func (*DropFilter) Name ¶
func (filter *DropFilter) Name() string
type ElasticsearchBulkRequestThrottle ¶
type ElasticsearchBulkRequestThrottle struct { Indices map[string]*config.Config `config:"indices"` // contains filtered or unexported fields }
func (*ElasticsearchBulkRequestThrottle) Filter ¶
func (this *ElasticsearchBulkRequestThrottle) Filter(ctx *fasthttp.RequestCtx)
func (*ElasticsearchBulkRequestThrottle) Name ¶
func (filter *ElasticsearchBulkRequestThrottle) Name() string
type ElasticsearchHealthCheckFilter ¶
type ElasticsearchHealthCheckFilter struct { Elasticsearch string `config:"elasticsearch"` Interval int `config:"interval"` }
func (*ElasticsearchHealthCheckFilter) Filter ¶
func (filter *ElasticsearchHealthCheckFilter) Filter(ctx *fasthttp.RequestCtx)
func (*ElasticsearchHealthCheckFilter) Name ¶
func (filter *ElasticsearchHealthCheckFilter) Name() string
type GenericLimiter ¶
type GenericLimiter struct { MaxRequests int `config:"max_requests"` BurstRequests int `config:"burst_requests"` MaxBytes int `config:"max_bytes"` BurstBytes int `config:"burst_bytes"` Interval string `config:"interval"` Action string `config:"action"` MaxRetryTimes int `config:"max_retry_times"` RetryDelayInMs int `config:"retry_delay_in_ms"` Status int `config:"status"` Message string `config:"message"` WarnMessage bool `config:"log_warn_message"` RetriedMessage string `config:"failed_retry_message"` // contains filtered or unexported fields }
type MatchRules ¶
type MatchRules struct { Pattern string `config:"pattern"` //pattern MaxQPS int64 `config:"max_qps"` //max_qps ExtractGroup string `config:"group"` // contains filtered or unexported fields }
func (*MatchRules) Extract ¶
func (this *MatchRules) Extract(input string) string
func (*MatchRules) Match ¶
func (this *MatchRules) Match(input string) bool
func (*MatchRules) Valid ¶
func (this *MatchRules) Valid() bool
type RequestAPIKeyLimitFilter ¶
type RequestAPIKeyLimitFilter struct { APIKeys []string `config:"id"` // contains filtered or unexported fields }
func (*RequestAPIKeyLimitFilter) Filter ¶
func (filter *RequestAPIKeyLimitFilter) Filter(ctx *fasthttp.RequestCtx)
func (*RequestAPIKeyLimitFilter) Name ¶
func (filter *RequestAPIKeyLimitFilter) Name() string
type RequestClientIPLimitFilter ¶
type RequestClientIPLimitFilter struct { IP []string `config:"ip"` // contains filtered or unexported fields }
func (*RequestClientIPLimitFilter) Filter ¶
func (filter *RequestClientIPLimitFilter) Filter(ctx *fasthttp.RequestCtx)
func (*RequestClientIPLimitFilter) Name ¶
func (filter *RequestClientIPLimitFilter) Name() string
type RequestHostLimitFilter ¶
type RequestHostLimitFilter struct { Host []string `config:"host"` // contains filtered or unexported fields }
func (*RequestHostLimitFilter) Filter ¶
func (filter *RequestHostLimitFilter) Filter(ctx *fasthttp.RequestCtx)
func (*RequestHostLimitFilter) Name ¶
func (filter *RequestHostLimitFilter) Name() string
type RequestPathLimitFilter ¶
type RequestPathLimitFilter struct { WarnMessage bool `config:"log_warn_message"` Message string `config:"message"` Rules []*MatchRules `config:"rules"` }
func (*RequestPathLimitFilter) Filter ¶
func (filter *RequestPathLimitFilter) Filter(ctx *fasthttp.RequestCtx)
func (*RequestPathLimitFilter) Name ¶
func (filter *RequestPathLimitFilter) Name() string
type RequestUserLimitFilter ¶
type RequestUserLimitFilter struct { User []string `config:"user"` // contains filtered or unexported fields }
func (*RequestUserLimitFilter) Filter ¶
func (filter *RequestUserLimitFilter) Filter(ctx *fasthttp.RequestCtx)
func (*RequestUserLimitFilter) Name ¶
func (filter *RequestUserLimitFilter) Name() string
type RetryLimiter ¶
type RetryLimiter struct { MaxRetryTimes int `config:"max_retry_times"` SleepInterval int `config:"retry_interval_in_ms"` Queue string `config:"queue_name"` TagsOnSuccess []string `config:"tag_on_success"` //hit limiter then add tag }
func (*RetryLimiter) Filter ¶
func (filter *RetryLimiter) Filter(ctx *fasthttp.RequestCtx)
func (*RetryLimiter) Name ¶
func (filter *RetryLimiter) Name() string
type SleepFilter ¶
type SleepFilter struct {
SleepInMs int `config:"sleep_in_million_seconds"`
}
func (*SleepFilter) Filter ¶
func (filter *SleepFilter) Filter(ctx *fasthttp.RequestCtx)
func (*SleepFilter) Name ¶
func (filter *SleepFilter) Name() string
Click to show internal directories.
Click to hide internal directories.