middleware

package
v0.0.0-...-c90f5ad Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const UserIDKey string = "userID"

Variables

This section is empty.

Functions

func AntiFlood

func AntiFlood(maxHits int, timeWindow, initialPenalty, maxPenalty, penaltyDecayWindow time.Duration) func(next http.Handler) http.Handler

func JWT

func JWT(next http.Handler) http.Handler

Types

type FloodInfo

type FloodInfo struct {
	Hits          int
	LastHit       time.Time
	WaitUntil     time.Time
	LastPenalty   time.Duration
	PenaltyExpire time.Time
}

Jump to

Keyboard shortcuts

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