Documentation
¶
Index ¶
- type BlockMap
- type BlocklistUpdater
- type DNSAdBlock
- 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 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 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 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.