Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLocalResolverAddressNotValid = errors.New("local resolver address is not valid") ErrLocalResolverPortIsZero = errors.New("local resolver port is zero") )
View Source
var ( ErrCacheLRUMaxEntriesNegative = errors.New("max entries is negative") ErrCacheLRUMaxEntriesZero = errors.New("max entries is zero") )
View Source
var ErrMiddlewareLogPathNotDirectory = errors.New("filepath specified for the middleware log is a directory")
View Source
var ErrTimeoutTooSmall = errors.New("timeout is too small")
View Source
var ErrUpdatePeriodTooShort = errors.New("update period is too short")
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { BlockMalicious *bool BlockAds *bool BlockSurveillance *bool AllowedHosts []string AllowedIPs []netip.Addr AllowedIPPrefixes []netip.Prefix AddBlockedHosts []string AddBlockedIPs []netip.Addr AddBlockedIPPrefixes []netip.Prefix }
func (*Block) ToLinesNode ¶
type Cache ¶
type Cache struct { // Type is the cache type, and can be // 'lru' or 'noop'. It defaults to 'lru' if // left unset. Type string LRU CacheLRU }
func (*Cache) ToLinesNode ¶
type CacheLRU ¶
type CacheLRU struct { // MaxEntries is the number of maximum entries // to keep in the LRU cache. It defaults to 10e4 // if letf unset. // Note its type is int instead of uint* since it is // used to compare against an int length so its maximum // is math.MaxInt which depends on the platform. MaxEntries int }
func (*CacheLRU) ToLinesNode ¶
type DoH ¶
type DoH struct { // UpstreamResolvers is a list of DNS over HTTPS upstream // resolvers to use. UpstreamResolvers []string // Timeout is the maximum duration to wait for a response from // upstream DNS over HTTPS servers. If left unset, it defaults // to 1 second. Timeout time.Duration }
func (*DoH) ToLinesNode ¶
type DoT ¶
type DoT struct { // UpstreamResolvers is a list of DNS over TLS upstream // resolvers to use. UpstreamResolvers []string // Timeout is the maximum duration to wait for a response from // upstream DNS over TLS servers. If left unset, it defaults to // 1 second. Timeout time.Duration }
func (*DoT) ToLinesNode ¶
type LocalDNS ¶
func (*LocalDNS) ToLinesNode ¶
type Log ¶
func (*Log) ToLinesNode ¶
type Metrics ¶
type Metrics struct { Type string Prometheus Prometheus }
func (*Metrics) ToLinesNode ¶
type MiddlewareLog ¶
func (*MiddlewareLog) String ¶
func (m *MiddlewareLog) String() string
func (*MiddlewareLog) ToLinesNode ¶
func (m *MiddlewareLog) ToLinesNode() (node *gotree.Node)
type Plain ¶
type Plain struct { // UpstreamResolvers is a list of DNS upstream resolvers to use. UpstreamResolvers []string // Timeout is the maximum duration to wait for a response from // upstream plaintext DNS servers. If left unset, it defaults to // 1 second. Timeout time.Duration }
func (*Plain) ToLinesNode ¶
type Prometheus ¶
func (*Prometheus) SetDefaults ¶
func (p *Prometheus) SetDefaults()
func (*Prometheus) String ¶
func (p *Prometheus) String() string
func (*Prometheus) ToLinesNode ¶
func (p *Prometheus) ToLinesNode() (node *gotree.Node)
func (*Prometheus) Validate ¶
func (p *Prometheus) Validate() (err error)
type Settings ¶
type Settings struct { // Upstream is the DNS upstream connection type // and can be either 'dot' or 'doh'. // It defaults to 'dot' if left uset. Upstream string // ListeningAddress is the DNS server listening address. // It can be set to the empty string to listen on all interfaces // on a random available port. // It defaults to ":53". ListeningAddress *string Block Block Cache Cache DoH DoH DoT DoT Plain Plain Log Log MiddlewareLog MiddlewareLog Metrics Metrics LocalDNS LocalDNS Substituter substituter.Settings CheckDNS *bool UpdatePeriod *time.Duration }
Settings contain settings to configure the entire program and to live patch the program from external sources.
func (*Settings) SetDefaults ¶
func (s *Settings) SetDefaults()
func (*Settings) ToLinesNode ¶
Click to show internal directories.
Click to hide internal directories.