Documentation
¶
Index ¶
- func IsIpExcluded(clientIP string, exemptIps []*net.IPNet) bool
- func IsIpGoodBot(clientIP string, goodBots []string) bool
- func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error)
- func ParseCIDR(cidr string) (*net.IPNet, error)
- func ParseIp(ip string, ipv4Mask, ipv6Mask int) (string, string)
- type CaptchaConfig
- type CaptchaProtect
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsIpGoodBot ¶
Types ¶
type CaptchaConfig ¶
type CaptchaConfig struct {
// contains filtered or unexported fields
}
type CaptchaProtect ¶
type CaptchaProtect struct {
// contains filtered or unexported fields
}
func (*CaptchaProtect) ServeHTTP ¶
func (bc *CaptchaProtect) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type Config ¶
type Config struct {
RateLimit uint `json:"rateLimit"`
Window int64 `json:"window"`
IPv4SubnetMask int `json:"ipv4subnetMask"`
IPv6SubnetMask int `json:"ipv6subnetMask"`
IPForwardedHeader string `json:"ipForwardedHeader"`
ProtectParameters string `json:"protectParameters"`
ProtectRoutes []string `json:"protectRoutes"`
GoodBots []string `json:"goodBots"`
ExemptIPs []string `json:"exemptIps"`
ChallengeURL string `json:"challengeURL"`
ChallengeTmpl string `json:"challengeTmpl"`
CaptchaProvider string `json:"captchaProvider"`
SiteKey string `json:"siteKey"`
SecretKey string `json:"secretKey"`
EnableStatsPage string `json:"enableStatsPage"`
LogLevel string `json:"loglevel,omitempty"`
}
func CreateConfig ¶
func CreateConfig() *Config
Click to show internal directories.
Click to hide internal directories.