Files
gin-contrib/limit/options.go
T
2024-03-29 11:40:39 +03:00

19 lines
298 B
Go

package limit
import "gitverse.ru/andoma/gin"
type Handler func(c *gin.Context, remoteAddr, CIDRs string) bool
type Limit struct {
handler Handler
}
type Option func(*Limit)
// WithHandler
func WithHandler(handler Handler) Option {
return func(limit *Limit) {
limit.handler = handler
}
}