redislimiter

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limit

type Limit struct {
	Limit  int
	Window time.Duration
}

Limit defines window and max count for a bucket.

type Limiter

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

Limiter is a Redis-backed sliding window limiter using ZSETs.

func New

func New(rdb *redis.Client, limits map[string]Limit) *Limiter

func (*Limiter) AllowNamed

func (l *Limiter) AllowNamed(bucket, key string) (bool, error)

AllowNamed matches the auth adapter's internal interface.

Jump to

Keyboard shortcuts

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