Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMiddleware ¶
provide a middleware that check if the source IP is banned
Types ¶
type Middleware ¶
type Middleware struct { StrikesMax uint32 `default:"3"` Checktick time.Duration `default:"1m"` Timeout time.Duration `default:"3m"` HoldTime time.Duration `default:"500ms"` // this is the time, we hold a client in line when it is banned // contains filtered or unexported fields }
Define our struct
func (*Middleware) CheckMiddleware ¶
func (mdw *Middleware) CheckMiddleware(next http.Handler) http.Handler
provide a middleware that check if the source IP is banned
func (*Middleware) Init ¶
func (mdw *Middleware) Init()
func (*Middleware) Strike ¶
func (mdw *Middleware) Strike(req *http.Request)
Click to show internal directories.
Click to hide internal directories.