ratelimit

package
v1.32.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCERateLimiter

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

GCERateLimiter implements cloud.RateLimiter

func NewGCERateLimiter

func NewGCERateLimiter(specs []string, operationPollInterval time.Duration, logger klog.Logger) (*GCERateLimiter, error)

NewGCERateLimiter parses the list of rate limiting specs passed in and returns a properly configured cloud.RateLimiter implementation. Expected format of specs: {"[version].[service].[operation],[type],[param1],[param2],..", "..."}

func (*GCERateLimiter) Accept

func (grl *GCERateLimiter) Accept(ctx context.Context, key *cloud.RateLimitKey) error

Accept looks up the associated strategyRateLimiter (if exists) and waits on it. Then it looks up the associated flowcontrol.RateLimiter (if exists) and waits on it.

func (*GCERateLimiter) Observe added in v1.23.0

func (grl *GCERateLimiter) Observe(ctx context.Context, err error, key *cloud.RateLimitKey)

Observe looks up the associated strategyRateLimiter (if exists) and passes an error there to observe.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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