ratelimit

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_WINDOW = 60
	DEFAULT_LIMIT  = 60
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UserCounter

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

type WindowCounter

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

WindowCounter implements a simple window counter

func NewWindowCounter

func NewWindowCounter(windowSeconds, limit int) *WindowCounter

func (*WindowCounter) Allow

func (rl *WindowCounter) Allow(userID string) bool

Jump to

Keyboard shortcuts

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