ratelimit

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitConfig

type RateLimitConfig struct {
	helper.TransformerConfig `yaml:",inline"`

	Rate     float64         `json:"rate,omitempty"     yaml:"rate,omitempty"`
	Interval helper.Duration `json:"interval,omitempty" yaml:"interval,omitempty"`
	Burst    uint            `json:"burst,omitempty"    yaml:"burst,omitempty"`
}

RateLimitConfig is the configuration of a rate filter operator.

func NewRateLimitConfig

func NewRateLimitConfig(operatorID string) *RateLimitConfig

NewRateLimitConfig creates a new rate limit config with default values

func (RateLimitConfig) Build

Build will build a rate limit operator.

type RateLimitOperator

type RateLimitOperator struct {
	helper.TransformerOperator
	// contains filtered or unexported fields
}

RateLimitOperator is an operator that limits the rate of log consumption between operators.

func (*RateLimitOperator) Process

func (p *RateLimitOperator) Process(ctx context.Context, entry *entry.Entry) error

Process will wait until a rate is met before sending an entry to the output.

func (*RateLimitOperator) Start

func (p *RateLimitOperator) Start() error

Start will start the rate limit operator.

func (*RateLimitOperator) Stop

func (p *RateLimitOperator) Stop() error

Stop will stop the rate limit operator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL