ratelimit

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

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 NewRedisSlidingWindowLimiter

func NewRedisSlidingWindowLimiter(cmd redis.Cmdable, interval time.Duration, rate int) Limiter

type RedisSlidingWindowLimiter

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

func (*RedisSlidingWindowLimiter) Limit

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

Directories

Path Synopsis
Package limitmocks is a generated GoMock package.
Package limitmocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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