middleware

package
v0.0.0-...-ea861e2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicUnitAuth

func BasicUnitAuth() gin.HandlerFunc

func BasicUserAuth

func BasicUserAuth() gin.HandlerFunc

func BodyLimit

func BodyLimit(maxBytes int64) gin.HandlerFunc

BodyLimit rejects requests whose body exceeds maxBytes before any downstream binding reads it, so unauthenticated or semi-trusted routes cannot be used to exhaust memory with oversized payloads.

func InitJWT

func InitJWT() *jwt.GinJWTMiddleware

func InstanceJWT

func InstanceJWT() *jwt.GinJWTMiddleware

func RateLimiter

func RateLimiter(rps rate.Limit, burst int) gin.HandlerFunc

RateLimiter throttles requests per client IP with a token-bucket limiter, so an unauthenticated route cannot be flooded with enough concurrent requests to exhaust memory before BodyLimit's per-request cap can help (BodyLimit bounds one request's body, not how many requests run at once). rps is the sustained rate and burst the number of requests allowed instantly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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