Versions in this module Expand all Collapse all v0 v0.0.2 Mar 25, 2019 v0.0.1 Mar 25, 2019 Changes in this version + func NewProcessor(cfg *common.Config) (processors.Processor, error) + type BucketLimiter struct + func NewBucketLimiter(bucketInterval, limit, buckets int64, now time.Time) *BucketLimiter + func (bl *BucketLimiter) Allow(t time.Time) bool + func (bl *BucketLimiter) LastUpdate() time.Time + func (bl *BucketLimiter) SetLimit(limit int64) + func (bl *BucketLimiter) WriteStatus(w io.Writer) error + type ConditionLimiter struct + func NewConditionLimiter(fields map[string]string, bucketInterval, limit, buckets int64, now time.Time) (*ConditionLimiter, error) + func (cl *ConditionLimiter) Allow(t time.Time) bool + func (cl *ConditionLimiter) Check(e *beat.Event) bool + func (cl *ConditionLimiter) SetLimit(limit int64) + func (cl *ConditionLimiter) WriteStatus(w io.Writer) error + type Config struct + BucketSize int64 + Buckets int64 + MetricLabels []LabelMapping + MetricName string + PolicyHost string + PolicyUpdateInterval time.Duration + PrometheusPort int + func (c Config) GetFields() []string + func (c Config) GetMetricLabels() []string + type LabelMapping struct + From string + To string + type Processor struct + func (mp *Processor) Close() error + func (mp *Processor) Run(event *beat.Event) (*beat.Event, error) + func (mp *Processor) RunHTTPHandlers(port int) + func (mp *Processor) String() string + type RemoteConfig struct + DefaultLimit int64 + Key string + Rules []RuleConfig + type RemoteLimiter struct + func NewRemoteLimiter(url string, bucketInterval, buckets int64) (*RemoteLimiter, error) + func (rl *RemoteLimiter) Allow(e *beat.Event) bool + func (rl *RemoteLimiter) Update(ctx context.Context) error + func (rl *RemoteLimiter) UpdateWithInterval(ctx context.Context, interval time.Duration) error + func (rl *RemoteLimiter) WriteStatus(w io.Writer) error + type Rule struct + func NewRule(fields map[string]string, limit int64) Rule + func (r Rule) Limit() int64 + func (r Rule) Match(e *beat.Event) (ok bool, key string) + type RuleConfig struct + Limit int64 + Selectors map[string]string