rlimit

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimit

type RateLimit struct {
	Requests  int
	TimeFrame time.Duration
	IPAccess  map[string]*Request
}

func New

func New(requests int, timeframe time.Duration) *RateLimit

func (*RateLimit) Limit

func (rl *RateLimit) Limit(next http.Handler) http.Handler

type Request

type Request struct {
	Last  time.Time
	Total int
}

Jump to

Keyboard shortcuts

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