Files
gin-contrib/limit/options.go
T
2024-04-02 15:13:13 +03:00

19 lines
301 B
Go

package limit
import "git.company.lan/gopkg/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
}
}