ratelimit

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitCalculator

type RateLimitCalculator struct {
	// contains filtered or unexported fields
}

func NewRateLimitCalculatorOrDie

func NewRateLimitCalculatorOrDie(defaultUnit string, defaultLimitValue int32) *RateLimitCalculator

func (*RateLimitCalculator) Calculate

func (r *RateLimitCalculator) Calculate(namespaceValue, sensorValue *sensor.RateLimit) sensor.RateLimit

Calculates the RateLimit based on min(sensorValue, maxRateLimit) where maxRateLimit is the namespaceValue if set, otherwise defaultRateLimit.

Jump to

Keyboard shortcuts

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