Documentation
¶
Index ¶
- type BlockMap
- type BlocklistUpdater
- type DNSAdBlock
- type MemoryStatHandler
- func (h *MemoryStatHandler) Cleanup() error
- func (h *MemoryStatHandler) Close() error
- func (h *MemoryStatHandler) Delete(uid string) error
- func (h *MemoryStatHandler) GetRequestsBetween(from, to time.Time) []Request
- func (h *MemoryStatHandler) GetStats() Stats
- func (h *MemoryStatHandler) Init() error
- func (h *MemoryStatHandler) Insert(request Request) (string, error)
- type Request
- type RuleSet
- func (r *RuleSet) AddRegexToBlacklist(regex string) error
- func (r *RuleSet) AddRegexToWhitelist(regex string) error
- func (r *RuleSet) AddToBlacklist(qname string)
- func (r *RuleSet) AddToWhitelist(qname string)
- func (r *RuleSet) IsBlacklisted(qname string) bool
- func (r *RuleSet) IsWhitelisted(qname string) bool
- type StatHandler
- type StatRepository
- type Stats
- type StoredBlocklistConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockMap ¶
func GenerateBlockageMap ¶
type BlocklistUpdater ¶
type BlocklistUpdater struct {
Enabled bool
UpdateInterval time.Duration
RetryCount int
RetryDelay time.Duration
Plugin *DNSAdBlock
// contains filtered or unexported fields
}
func (*BlocklistUpdater) Start ¶
func (u *BlocklistUpdater) Start()
type DNSAdBlock ¶
type MemoryStatHandler ¶
func (*MemoryStatHandler) Cleanup ¶
func (h *MemoryStatHandler) Cleanup() error
func (*MemoryStatHandler) Close ¶
func (h *MemoryStatHandler) Close() error
func (*MemoryStatHandler) Delete ¶
func (h *MemoryStatHandler) Delete(uid string) error
func (*MemoryStatHandler) GetRequestsBetween ¶
func (h *MemoryStatHandler) GetRequestsBetween(from, to time.Time) []Request
func (*MemoryStatHandler) GetStats ¶
func (h *MemoryStatHandler) GetStats() Stats
func (*MemoryStatHandler) Init ¶
func (h *MemoryStatHandler) Init() error
type RuleSet ¶
type RuleSet struct {
Blacklist map[string]bool
Whitelist map[string]bool
WhitelistRegex []*regexp.Regexp
BlacklistRegex []*regexp.Regexp
}
func BuildRuleset ¶
func (*RuleSet) AddRegexToBlacklist ¶
func (*RuleSet) AddRegexToWhitelist ¶
func (*RuleSet) AddToBlacklist ¶
func (*RuleSet) AddToWhitelist ¶
func (*RuleSet) IsBlacklisted ¶
func (*RuleSet) IsWhitelisted ¶
type StatHandler ¶
type StatHandler struct {
Enabled bool
Endpoint string
Repo StatRepository
}
func (*StatHandler) Init ¶
func (s *StatHandler) Init() error
type StatRepository ¶
type StoredBlocklistConfiguration ¶
type StoredBlocklistConfiguration struct {
UpdateTimestamp int `json:"update_timestamp"`
Blocklists []string `json:"blocklists"`
BlockedNames BlockMap `json:"blocked_names"`
}
func ReadBlocklistConfiguration ¶
func ReadBlocklistConfiguration(path string) (*StoredBlocklistConfiguration, error)
func (*StoredBlocklistConfiguration) NeedsUpdate ¶
func (s *StoredBlocklistConfiguration) NeedsUpdate(updateDuration time.Duration) bool
func (*StoredBlocklistConfiguration) Persist ¶
func (s *StoredBlocklistConfiguration) Persist(path string) error
Click to show internal directories.
Click to hide internal directories.