ratelimit

package
v0.0.0-...-d13da26 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter interface {
	Limit(ctx context.Context, key string) (bool, error)
}

func NewRedisSlideWindowLimiter

func NewRedisSlideWindowLimiter(cmd redis.Cmdable, threshold int, interval time.Duration) Limiter

type RedisSlideWindowLimiter

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

func (*RedisSlideWindowLimiter) Limit

func (r *RedisSlideWindowLimiter) Limit(ctx context.Context, key string) (bool, error)

Jump to

Keyboard shortcuts

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