package
2.12.0+incompatible
Repository: https://github.com/adguardteam/adguarddns.git
Documentation: pkg.go.dev
# Packages
Package custom contains filters made from custom filtering rules of clients.
Package filterstorage defines an interface for a storage of filters as well as the default implementation and the filter configuration.
Package hashprefix defines a storage of hashes of domain names used for filtering and serving TXT records with domain-name hashes.
# Functions
NewBlockedServiceID converts a simple string into a BlockedServiceID and makes sure that it's valid.
NewID converts a simple string into an ID and makes sure that it's valid.
NewRuleText converts a simple string into a RuleText and makes sure that it's valid.
# Constants
Default safe-browsing host suffixes.
Default safe-browsing host suffixes.
IDAdGuardDNS is the special filter ID of the main AdGuard DNS filtering-rule list.
IDAdultBlocking is the special shared filter ID used when a request was filtered by the adult content blocking filter.
IDBlockedService is the shared filter ID used when a request was blocked by the service blocker.
IDCustom is the special shared filter ID used when a request was filtered by a custom profile rule.
IDGeneralSafeSearch is the shared filter ID used when a request was modified by the general safe search filter.
IDNewRegDomains is the special shared filter ID used when a request was filtered by the newly registered domains filter.
IDNone means that no filter were applied at all.
IDSafeBrowsing is the special shared filter ID used when a request was filtered by the safe browsing filter.
IDYoutubeSafeSearch is the special shared filter ID used when a request was modified by the YouTube safe search filter.
The maximum and minimum lengths of a blocked service ID.
MaxDayIntervalEndMinutes is the maximum value for [DayInterval.End].
MaxDayIntervalStartMinutes is the maximum value for [DayInterval.Start].
The maximum and minimum lengths of a filter ID.
MaxRuleTextRuneLen is the maximum length of a filter rule in runes.
The maximum and minimum lengths of a blocked service ID.
The maximum and minimum lengths of a filter ID.
StoragePrefix is a common prefix for logging and refreshes of the filter storage.
# Structs
ConfigClient is a [Config] for a client.
ConfigCustom is the configuration for identification or construction of a custom filter for a client.
ConfigGroup is a [Config] for a filtering group.
ConfigParental is the configuration for parental-control filtering.
ConfigRuleList is the configuration for rule-list based filtering.
ConfigSafeBrowsing is the configuration for safe-browsing filtering.
ConfigSchedule is the schedule of a client's parental protection.
DayInterval is an interval within a single day.
Empty is an [Interface] implementation that always returns nil.
EmptyMetrics is the implementation of the [Metrics] interface that does nothing.
Request contains information about a request being filtered.
Response contains information about a response being filtered.
ResultAllowed means that this request or response was allowed by an allowlist rule within the given filter list.
ResultBlocked means that this request or response was blocked by a blocklist rule within the given filter list.
ResultModifiedRequest means that this request was rewritten or modified by a rewrite rule within the given filter list.
ResultModifiedResponse means that this response was rewritten or modified by a rewrite rule within the given filter list.
# Interfaces
Config is the sum type of [Storage.ForConfig] configurations.
Custom is a custom filter for a client.
HashMatcher is the interface for a safe-browsing and adult-blocking hash matcher, which is used to respond to a TXT query based on the domain name.
Interface is the DNS request and response filter interface.
Metrics is the interface for metrics of filters.
Result is a sum type of all possible filtering actions.
Storage is the interface for filter storages that can build a filter based on a configuration.
# Type aliases
BlockedServiceID is the ID of a blocked service.
ID is the ID of a filter list.
RuleText is the text of a single rule within a rule-list filter.
WeeklySchedule is a schedule for one week.