Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArrayStorage ¶ added in v0.1.0
type ArrayStorage struct {
// contains filtered or unexported fields
}
ArrayStorage implements BlockStorage using an array.
type BlockManager ¶ added in v0.1.0
type BlockManager struct {
// contains filtered or unexported fields
}
BlockManager defines the struct for managing IP addresses.
func ArrayBlockManager ¶ added in v0.1.0
func ArrayBlockManager() *BlockManager
func RedisBlockManager ¶ added in v0.1.0
func RedisBlockManager(host string) *BlockManager
type BlockStorage ¶ added in v0.1.0
type BlockStorage interface {
IsBlocked(ip net.IP) bool
Block(ip net.IP, minutes int) error
UnBlock(ip net.IP) error
}
BlockStorage defines the interface for managing IP addresses.
type Config ¶
type Config struct {
RegexPatterns []string `json:"regexPatterns,omitempty"`
BlockDurationMinutes int `json:"blockDurationMinutes,omitempty"`
Whitelist []string `json:"whitelist,omitempty"`
EnableDebug bool `json:"enableDebug,omitempty"`
}
Config defines the configuration options for the plugin.
func CreateConfig ¶
func CreateConfig() *Config
CreateConfig creates a default configuration for the plugin.
type RedisStorage ¶ added in v0.1.0
type RedisStorage struct {
// contains filtered or unexported fields
}
RedisStorage implements BlockStorage using a Redis connection.
type RegexBlock ¶
type RegexBlock struct {
// contains filtered or unexported fields
}
RegexBlock is a Traefik plugin that blocks requests matching certain regex patterns.
func (*RegexBlock) ServeHTTP ¶
func (p *RegexBlock) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP intercepts the request and blocks it if it matches any of the configured regex patterns.