Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Denylist []string `json:"deny"` Allowlist []string `json:"allow"` Patterns []string `json:"patterns"` CacheSize int `json:"cache_size"` RejectIfEmpty bool `json:"empty_user_agent_is_bot"` }
Config defines the behaviour of the detector
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector is a struct able to detect bot-made requests
type DetectorFunc ¶
DetectorFunc is a func that chek if a request was made by a bot
func New ¶
func New(cfg Config) (DetectorFunc, error)
New returns a detector function with or without LRU cache depending on the params
type LRUDetector ¶
type LRUDetector struct {
// contains filtered or unexported fields
}
LRUDetector is a struct able to detect bot-made requests and cache the results for future reutilization
Click to show internal directories.
Click to hide internal directories.