middleware

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_PRINT_BODY_LEN = 5120

Variables

This section is empty.

Functions

func Cors

func Cors() gin.HandlerFunc

func IPRateLimit

func IPRateLimit(counter *IPRequestCounter, maxRequests int, duration time.Duration) gin.HandlerFunc

func Print

func Print(logger *logx.Gin) gin.HandlerFunc

func Recover

func Recover(debug bool) gin.HandlerFunc

func Trace

func Trace() gin.HandlerFunc

Types

type IPRequestCounter

type IPRequestCounter struct {
	Counters map[string]int
	Lock     sync.Mutex
}

Jump to

Keyboard shortcuts

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