Documentation ¶
Overview ¶
Package blocklist provides a blocklist based on ip and user-agent regexp.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blocklist ¶
type Blocklist struct { Code *int `yaml:"code"` Message *string `yaml:"message"` IP []string `yaml:"ip"` UA []string `yaml:"ua"` // contains filtered or unexported fields }
A Blocklist is a IP and User-Agent based blocklist.
Zero value is a valid Blocklist that matches nothing.
A non-zero Blocklist must call Parse first before it can be used.
func (Blocklist) Middleware ¶
Middleware provides a HTTP middleware based on the configured blocklist.
Click to show internal directories.
Click to hide internal directories.