Documentation ¶
Index ¶
- Constants
- Variables
- func BytesSourceTypeNames() []string
- func ConvertPort(in string) (uint16, error)
- func IPVersionNames() []string
- func InitStrategyNames() []string
- func NetProtocolNames() []string
- func QueryLogFieldNames() []string
- func QueryLogTypeNames() []string
- func TLSVersionNames() []string
- func UpstreamStrategyNames() []string
- func WithDefaults[T any]() (T, error)
- type Blocking
- type BootstrapDNS
- type BootstrappedUpstream
- type BytesSource
- type BytesSourceType
- type Caching
- type ClientLookup
- type ConditionalUpstream
- type ConditionalUpstreamMapping
- type Config
- type Configurable
- type CustomDNS
- type CustomDNSEntries
- type CustomDNSMapping
- type Downloader
- type Duration
- type ECS
- type ECSv4Mask
- type ECSv6Mask
- type EDE
- type FQDNOnly
- type Filtering
- type HostsFile
- type IPVersion
- type Init
- type InitStrategy
- type ListenConfig
- type Metrics
- type NetProtocol
- type Ports
- type QType
- type QTypeSet
- type QueryLog
- type QueryLogField
- type QueryLogIgnore
- type QueryLogType
- type Redis
- type RewriterConfig
- type SUDN
- type SourceLoading
- type TLSVersion
- type Upstream
- type UpstreamGroup
- type UpstreamGroups
- type UpstreamStrategy
- type Upstreams
- type ZoneFileDNS
Constants ¶
const UpstreamDefaultCfgName = "default"
Variables ¶
var ErrInvalidBytesSourceType = fmt.Errorf("not a valid BytesSourceType, try [%s]", strings.Join(_BytesSourceTypeNames, ", "))
var ErrInvalidIPVersion = fmt.Errorf("not a valid IPVersion, try [%s]", strings.Join(_IPVersionNames, ", "))
var ErrInvalidInitStrategy = fmt.Errorf("not a valid InitStrategy, try [%s]", strings.Join(_InitStrategyNames, ", "))
var ErrInvalidNetProtocol = fmt.Errorf("not a valid NetProtocol, try [%s]", strings.Join(_NetProtocolNames, ", "))
var ErrInvalidQueryLogField = fmt.Errorf("not a valid QueryLogField, try [%s]", strings.Join(_QueryLogFieldNames, ", "))
var ErrInvalidQueryLogType = fmt.Errorf("not a valid QueryLogType, try [%s]", strings.Join(_QueryLogTypeNames, ", "))
var ErrInvalidTLSVersion = fmt.Errorf("not a valid TLSVersion, try [%s]", strings.Join(_TLSVersionNames, ", "))
var ErrInvalidUpstreamStrategy = fmt.Errorf("not a valid UpstreamStrategy, try [%s]", strings.Join(_UpstreamStrategyNames, ", "))
Functions ¶
func BytesSourceTypeNames ¶
func BytesSourceTypeNames() []string
BytesSourceTypeNames returns a list of possible string values of BytesSourceType.
func ConvertPort ¶
ConvertPort converts string representation into a valid port (0 - 65535)
func IPVersionNames ¶
func IPVersionNames() []string
IPVersionNames returns a list of possible string values of IPVersion.
func InitStrategyNames ¶
func InitStrategyNames() []string
InitStrategyNames returns a list of possible string values of InitStrategy.
func NetProtocolNames ¶
func NetProtocolNames() []string
NetProtocolNames returns a list of possible string values of NetProtocol.
func QueryLogFieldNames ¶
func QueryLogFieldNames() []string
QueryLogFieldNames returns a list of possible string values of QueryLogField.
func QueryLogTypeNames ¶
func QueryLogTypeNames() []string
QueryLogTypeNames returns a list of possible string values of QueryLogType.
func TLSVersionNames ¶
func TLSVersionNames() []string
TLSVersionNames returns a list of possible string values of TLSVersion.
func UpstreamStrategyNames ¶
func UpstreamStrategyNames() []string
UpstreamStrategyNames returns a list of possible string values of UpstreamStrategy.
func WithDefaults ¶
Types ¶
type Blocking ¶
type Blocking struct { BlackLists map[string][]BytesSource `yaml:"blackLists"` WhiteLists map[string][]BytesSource `yaml:"whiteLists"` ClientGroupsBlock map[string][]string `yaml:"clientGroupsBlock"` BlockType string `yaml:"blockType" default:"ZEROIP"` BlockTTL Duration `yaml:"blockTTL" default:"6h"` Loading SourceLoading `yaml:"loading"` // Deprecated options Deprecated struct { DownloadTimeout *Duration `yaml:"downloadTimeout"` DownloadAttempts *uint `yaml:"downloadAttempts"` DownloadCooldown *Duration `yaml:"downloadCooldown"` RefreshPeriod *Duration `yaml:"refreshPeriod"` FailStartOnListError *bool `yaml:"failStartOnListError"` ProcessingConcurrency *uint `yaml:"processingConcurrency"` StartStrategy *InitStrategy `yaml:"startStrategy"` MaxErrorsPerFile *int `yaml:"maxErrorsPerFile"` } `yaml:",inline"` }
Blocking configuration for query blocking
type BootstrapDNS ¶
type BootstrapDNS bootstrapDNS
split in two types to avoid infinite recursion. See `BootstrapDNS.UnmarshalYAML`.
func (*BootstrapDNS) IsEnabled ¶
func (b *BootstrapDNS) IsEnabled() bool
func (*BootstrapDNS) LogConfig ¶
func (b *BootstrapDNS) LogConfig(*logrus.Entry)
func (*BootstrapDNS) UnmarshalYAML ¶
func (b *BootstrapDNS) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML creates BootstrapDNS from YAML
type BootstrappedUpstream ¶
type BootstrappedUpstream bootstrappedUpstream
split in two types to avoid infinite recursion. See `BootstrappedUpstream.UnmarshalYAML`.
func (*BootstrappedUpstream) UnmarshalYAML ¶
func (b *BootstrappedUpstream) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML creates BootstrappedUpstream from YAML
type BytesSource ¶
type BytesSource struct { Type BytesSourceType From string }
func NewBytesSources ¶
func NewBytesSources(sources ...string) []BytesSource
func TextBytesSource ¶
func TextBytesSource(lines ...string) BytesSource
func (BytesSource) String ¶
func (s BytesSource) String() string
func (*BytesSource) UnmarshalText ¶
func (s *BytesSource) UnmarshalText(data []byte) error
UnmarshalText implements `encoding.TextUnmarshaler`.
type BytesSourceType ¶
type BytesSourceType uint16
BytesSourceType supported BytesSource types. ENUM( text=1 // Inline YAML block. http // HTTP(S). file // Local file. )
const ( // BytesSourceTypeText is a BytesSourceType of type Text. // Inline YAML block. BytesSourceTypeText BytesSourceType = iota + 1 // BytesSourceTypeHttp is a BytesSourceType of type Http. // HTTP(S). BytesSourceTypeHttp // BytesSourceTypeFile is a BytesSourceType of type File. // Local file. BytesSourceTypeFile )
func BytesSourceTypeValues ¶
func BytesSourceTypeValues() []BytesSourceType
BytesSourceTypeValues returns a list of the values for BytesSourceType
func ParseBytesSourceType ¶
func ParseBytesSourceType(name string) (BytesSourceType, error)
ParseBytesSourceType attempts to convert a string to a BytesSourceType.
func (BytesSourceType) IsValid ¶
func (x BytesSourceType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (BytesSourceType) MarshalText ¶
func (x BytesSourceType) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (BytesSourceType) String ¶
func (x BytesSourceType) String() string
String implements the Stringer interface.
func (*BytesSourceType) UnmarshalText ¶
func (x *BytesSourceType) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type Caching ¶
type Caching struct { MinCachingTime Duration `yaml:"minTime"` MaxCachingTime Duration `yaml:"maxTime"` CacheTimeNegative Duration `yaml:"cacheTimeNegative" default:"30m"` MaxItemsCount int `yaml:"maxItemsCount"` Prefetching bool `yaml:"prefetching"` PrefetchExpires Duration `yaml:"prefetchExpires" default:"2h"` PrefetchThreshold int `yaml:"prefetchThreshold" default:"5"` PrefetchMaxItemsCount int `yaml:"prefetchMaxItemsCount"` }
Caching configuration for domain caching
func (*Caching) EnablePrefetch ¶
func (c *Caching) EnablePrefetch()
type ClientLookup ¶
type ClientLookup struct { ClientnameIPMapping map[string][]net.IP `yaml:"clients"` Upstream Upstream `yaml:"upstream"` SingleNameOrder []uint `yaml:"singleNameOrder"` }
ClientLookup configuration for the client lookup
func (*ClientLookup) IsEnabled ¶
func (c *ClientLookup) IsEnabled() bool
IsEnabled implements `config.Configurable`.
func (*ClientLookup) LogConfig ¶
func (c *ClientLookup) LogConfig(logger *logrus.Entry)
LogConfig implements `config.Configurable`.
type ConditionalUpstream ¶
type ConditionalUpstream struct { RewriterConfig `yaml:",inline"` Mapping ConditionalUpstreamMapping `yaml:"mapping"` }
ConditionalUpstream conditional upstream configuration
func (*ConditionalUpstream) IsEnabled ¶
func (c *ConditionalUpstream) IsEnabled() bool
IsEnabled implements `config.Configurable`.
func (*ConditionalUpstream) LogConfig ¶
func (c *ConditionalUpstream) LogConfig(logger *logrus.Entry)
LogConfig implements `config.Configurable`.
type ConditionalUpstreamMapping ¶
ConditionalUpstreamMapping mapping for conditional configuration
func (*ConditionalUpstreamMapping) UnmarshalYAML ¶
func (c *ConditionalUpstreamMapping) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements `yaml.Unmarshaler`.
type Config ¶
type Config struct { Upstreams Upstreams `yaml:"upstreams"` ConnectIPVersion IPVersion `yaml:"connectIPVersion"` CustomDNS CustomDNS `yaml:"customDNS"` Conditional ConditionalUpstream `yaml:"conditional"` Blocking Blocking `yaml:"blocking"` ClientLookup ClientLookup `yaml:"clientLookup"` Caching Caching `yaml:"caching"` QueryLog QueryLog `yaml:"queryLog"` Prometheus Metrics `yaml:"prometheus"` Redis Redis `yaml:"redis"` Log log.Config `yaml:"log"` Ports Ports `yaml:"ports"` MinTLSServeVer TLSVersion `yaml:"minTlsServeVersion" default:"1.2"` CertFile string `yaml:"certFile"` KeyFile string `yaml:"keyFile"` BootstrapDNS BootstrapDNS `yaml:"bootstrapDns"` HostsFile HostsFile `yaml:"hostsFile"` FQDNOnly FQDNOnly `yaml:"fqdnOnly"` Filtering Filtering `yaml:"filtering"` EDE EDE `yaml:"ede"` ECS ECS `yaml:"ecs"` SUDN SUDN `yaml:"specialUseDomains"` // Deprecated options Deprecated struct { Upstream *UpstreamGroups `yaml:"upstream"` UpstreamTimeout *Duration `yaml:"upstreamTimeout"` DisableIPv6 *bool `yaml:"disableIPv6"` LogLevel *logrus.Level `yaml:"logLevel"` LogFormat *log.FormatType `yaml:"logFormat"` LogPrivacy *bool `yaml:"logPrivacy"` LogTimestamp *bool `yaml:"logTimestamp"` DNSPorts *ListenConfig `yaml:"port"` HTTPPorts *ListenConfig `yaml:"httpPort"` HTTPSPorts *ListenConfig `yaml:"httpsPort"` TLSPorts *ListenConfig `yaml:"tlsPort"` StartVerifyUpstream *bool `yaml:"startVerifyUpstream"` DoHUserAgent *string `yaml:"dohUserAgent"` } `yaml:",inline"` }
Config main configuration
type Configurable ¶
type CustomDNS ¶
type CustomDNS struct { RewriterConfig `yaml:",inline"` CustomTTL Duration `yaml:"customTTL" default:"1h"` Mapping CustomDNSMapping `yaml:"mapping"` Zone ZoneFileDNS `yaml:"zone" default:""` FilterUnmappedTypes bool `yaml:"filterUnmappedTypes" default:"true"` }
CustomDNS custom DNS configuration
type CustomDNSEntries ¶
func (*CustomDNSEntries) UnmarshalYAML ¶
func (c *CustomDNSEntries) UnmarshalYAML(unmarshal func(interface{}) error) error
type CustomDNSMapping ¶
type CustomDNSMapping map[string]CustomDNSEntries
type Downloader ¶
type Downloader struct { Timeout Duration `yaml:"timeout" default:"5s"` Attempts uint `yaml:"attempts" default:"3"` Cooldown Duration `yaml:"cooldown" default:"500ms"` }
func (*Downloader) LogConfig ¶
func (c *Downloader) LogConfig(logger *logrus.Entry)
type Duration ¶
Duration is a wrapper for time.Duration to support yaml unmarshalling
func (Duration) IsAboveZero ¶
IsAboveZero returns true if duration is strictly greater than zero.
func (Duration) IsAtLeastZero ¶
IsAtLeastZero returns true if duration is greater or equal to zero.
func (Duration) SecondsU32 ¶
SecondsU32 returns duration in seconds as uint32
func (Duration) ToDuration ¶
ToDuration converts Duration to time.Duration
func (*Duration) UnmarshalText ¶
UnmarshalText implements `encoding.TextUnmarshaler`.
type ECS ¶
type ECS struct { UseAsClient bool `yaml:"useAsClient" default:"false"` Forward bool `yaml:"forward" default:"false"` IPv4Mask ECSv4Mask `yaml:"ipv4Mask" default:"0"` IPv6Mask ECSv6Mask `yaml:"ipv6Mask" default:"0"` }
ECS is the configuration of the ECS resolver
type ECSv4Mask ¶
type ECSv4Mask uint8
ECSv4Mask is the subnet mask to be added as EDNS0 option for IPv4
func (*ECSv4Mask) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface
type ECSv6Mask ¶
type ECSv6Mask uint8
ECSv6Mask is the subnet mask to be added as EDNS0 option for IPv6
func (*ECSv6Mask) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface
type Filtering ¶
type Filtering struct {
QueryTypes QTypeSet `yaml:"queryTypes"`
}
type HostsFile ¶
type HostsFile struct { Sources []BytesSource `yaml:"sources"` HostsTTL Duration `yaml:"hostsTTL" default:"1h"` FilterLoopback bool `yaml:"filterLoopback"` Loading SourceLoading `yaml:"loading"` // Deprecated options Deprecated struct { RefreshPeriod *Duration `yaml:"refreshPeriod"` Filepath *BytesSource `yaml:"filePath"` } `yaml:",inline"` }
type IPVersion ¶
type IPVersion uint8
IPVersion represents IP protocol version(s). ENUM( dual // IPv4 and IPv6 v4 // IPv4 only v6 // IPv6 only )
func IPVersionValues ¶
func IPVersionValues() []IPVersion
IPVersionValues returns a list of the values for IPVersion
func ParseIPVersion ¶
ParseIPVersion attempts to convert a string to a IPVersion.
func (IPVersion) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (IPVersion) MarshalText ¶
MarshalText implements the text marshaller method.
func (*IPVersion) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type Init ¶
type Init struct {
Strategy InitStrategy `yaml:"strategy" default:"blocking"`
}
type InitStrategy ¶
type InitStrategy uint16
InitStrategy startup strategy ENUM( blocking // synchronously download blocking lists on startup failOnError // synchronously download blocking lists on startup and shutdown on error fast // asyncronously download blocking lists on startup )
const ( // InitStrategyBlocking is a InitStrategy of type Blocking. // synchronously download blocking lists on startup InitStrategyBlocking InitStrategy = iota // InitStrategyFailOnError is a InitStrategy of type FailOnError. // synchronously download blocking lists on startup and shutdown on error InitStrategyFailOnError // InitStrategyFast is a InitStrategy of type Fast. // asyncronously download blocking lists on startup InitStrategyFast )
func InitStrategyValues ¶
func InitStrategyValues() []InitStrategy
InitStrategyValues returns a list of the values for InitStrategy
func ParseInitStrategy ¶
func ParseInitStrategy(name string) (InitStrategy, error)
ParseInitStrategy attempts to convert a string to a InitStrategy.
func (InitStrategy) IsValid ¶
func (x InitStrategy) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (InitStrategy) MarshalText ¶
func (x InitStrategy) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (InitStrategy) String ¶
func (x InitStrategy) String() string
String implements the Stringer interface.
func (*InitStrategy) UnmarshalText ¶
func (x *InitStrategy) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type ListenConfig ¶
type ListenConfig []string
ListenConfig is a list of address(es) to listen on
func (*ListenConfig) UnmarshalText ¶
func (l *ListenConfig) UnmarshalText(data []byte) error
UnmarshalText implements `encoding.TextUnmarshaler`.
type Metrics ¶
type Metrics struct { Enable bool `yaml:"enable" default:"false"` Path string `yaml:"path" default:"/metrics"` }
Metrics contains the config values for prometheus
type NetProtocol ¶
type NetProtocol uint16
NetProtocol resolver protocol ENUM( tcp+udp // TCP and UDP protocols tcp-tls // TCP-TLS protocol https // HTTPS protocol )
const ( // NetProtocolTcpUdp is a NetProtocol of type Tcp+Udp. // TCP and UDP protocols NetProtocolTcpUdp NetProtocol = iota // NetProtocolTcpTls is a NetProtocol of type Tcp-Tls. // TCP-TLS protocol NetProtocolTcpTls // NetProtocolHttps is a NetProtocol of type Https. // HTTPS protocol NetProtocolHttps )
func NetProtocolValues ¶
func NetProtocolValues() []NetProtocol
NetProtocolValues returns a list of the values for NetProtocol
func ParseNetProtocol ¶
func ParseNetProtocol(name string) (NetProtocol, error)
ParseNetProtocol attempts to convert a string to a NetProtocol.
func (NetProtocol) IsValid ¶
func (x NetProtocol) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (NetProtocol) MarshalText ¶
func (x NetProtocol) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (NetProtocol) String ¶
func (x NetProtocol) String() string
String implements the Stringer interface.
func (*NetProtocol) UnmarshalText ¶
func (x *NetProtocol) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type Ports ¶
type Ports struct { DNS ListenConfig `yaml:"dns" default:"53"` HTTP ListenConfig `yaml:"http"` HTTPS ListenConfig `yaml:"https"` TLS ListenConfig `yaml:"tls"` }
type QType ¶
func (*QType) UnmarshalText ¶
UnmarshalText implements `encoding.TextUnmarshaler`.
type QTypeSet ¶
type QTypeSet map[QType]struct{}
func NewQTypeSet ¶
func (*QTypeSet) UnmarshalYAML ¶
type QueryLog ¶
type QueryLog struct { Target string `yaml:"target"` Type QueryLogType `yaml:"type"` LogRetentionDays uint64 `yaml:"logRetentionDays"` CreationAttempts int `yaml:"creationAttempts" default:"3"` CreationCooldown Duration `yaml:"creationCooldown" default:"2s"` Fields []QueryLogField `yaml:"fields"` FlushInterval Duration `yaml:"flushInterval" default:"30s"` Ignore QueryLogIgnore `yaml:"ignore"` }
QueryLog configuration for the query logging
func (*QueryLog) SetDefaults ¶
func (c *QueryLog) SetDefaults()
SetDefaults implements `defaults.Setter`.
type QueryLogField ¶
type QueryLogField string
QueryLogField data field to be logged ENUM(clientIP,clientName,responseReason,responseAnswer,question,duration)
const ( // QueryLogFieldClientIP is a QueryLogField of type clientIP. QueryLogFieldClientIP QueryLogField = "clientIP" // QueryLogFieldClientName is a QueryLogField of type clientName. QueryLogFieldClientName QueryLogField = "clientName" // QueryLogFieldResponseReason is a QueryLogField of type responseReason. QueryLogFieldResponseReason QueryLogField = "responseReason" // QueryLogFieldResponseAnswer is a QueryLogField of type responseAnswer. QueryLogFieldResponseAnswer QueryLogField = "responseAnswer" // QueryLogFieldQuestion is a QueryLogField of type question. QueryLogFieldQuestion QueryLogField = "question" // QueryLogFieldDuration is a QueryLogField of type duration. QueryLogFieldDuration QueryLogField = "duration" )
func ParseQueryLogField ¶
func ParseQueryLogField(name string) (QueryLogField, error)
ParseQueryLogField attempts to convert a string to a QueryLogField.
func QueryLogFieldValues ¶
func QueryLogFieldValues() []QueryLogField
QueryLogFieldValues returns a list of the values for QueryLogField
func (QueryLogField) IsValid ¶
func (x QueryLogField) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (QueryLogField) MarshalText ¶
func (x QueryLogField) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (QueryLogField) String ¶
func (x QueryLogField) String() string
String implements the Stringer interface.
func (*QueryLogField) UnmarshalText ¶
func (x *QueryLogField) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type QueryLogIgnore ¶
type QueryLogIgnore struct {
SUDN bool `yaml:"sudn" default:"false"`
}
type QueryLogType ¶
type QueryLogType int16
QueryLogType type of the query log ENUM( console // use logger as fallback none // no logging mysql // MySQL or MariaDB database postgresql // PostgreSQL database csv // CSV file per day csv-client // CSV file per day and client )
const ( // QueryLogTypeConsole is a QueryLogType of type Console. // use logger as fallback QueryLogTypeConsole QueryLogType = iota // QueryLogTypeNone is a QueryLogType of type None. // no logging QueryLogTypeNone // QueryLogTypeMysql is a QueryLogType of type Mysql. // MySQL or MariaDB database QueryLogTypeMysql // QueryLogTypePostgresql is a QueryLogType of type Postgresql. // PostgreSQL database QueryLogTypePostgresql // QueryLogTypeCsv is a QueryLogType of type Csv. // CSV file per day QueryLogTypeCsv // QueryLogTypeCsvClient is a QueryLogType of type Csv-Client. // CSV file per day and client QueryLogTypeCsvClient )
func ParseQueryLogType ¶
func ParseQueryLogType(name string) (QueryLogType, error)
ParseQueryLogType attempts to convert a string to a QueryLogType.
func QueryLogTypeValues ¶
func QueryLogTypeValues() []QueryLogType
QueryLogTypeValues returns a list of the values for QueryLogType
func (QueryLogType) IsValid ¶
func (x QueryLogType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (QueryLogType) MarshalText ¶
func (x QueryLogType) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (QueryLogType) String ¶
func (x QueryLogType) String() string
String implements the Stringer interface.
func (*QueryLogType) UnmarshalText ¶
func (x *QueryLogType) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type Redis ¶
type Redis struct { Address string `yaml:"address"` Username string `yaml:"username" default:""` Password string `yaml:"password" default:""` Database int `yaml:"database" default:"0"` Required bool `yaml:"required" default:"false"` ConnectionAttempts int `yaml:"connectionAttempts" default:"3"` ConnectionCooldown Duration `yaml:"connectionCooldown" default:"1s"` SentinelUsername string `yaml:"sentinelUsername" default:""` SentinelPassword string `yaml:"sentinelPassword" default:""` SentinelAddresses []string `yaml:"sentinelAddresses"` }
Redis configuration for the redis connection
type RewriterConfig ¶
type RewriterConfig struct { Rewrite map[string]string `yaml:"rewrite"` FallbackUpstream bool `yaml:"fallbackUpstream" default:"false"` }
RewriterConfig custom DNS configuration
func (*RewriterConfig) IsEnabled ¶
func (c *RewriterConfig) IsEnabled() bool
IsEnabled implements `config.Configurable`.
func (*RewriterConfig) LogConfig ¶
func (c *RewriterConfig) LogConfig(logger *logrus.Entry)
LogConfig implements `config.Configurable`.
type SUDN ¶
type SUDN struct { // These are "recommended for private use" but not mandatory. // If a user wishes to use one, it will most likely be via conditional // upstream or custom DNS, which come before SUDN in the resolver chain. // Thus defaulting to `true` and returning NXDOMAIN here should not conflict. RFC6762AppendixG bool `yaml:"rfc6762-appendixG" default:"true"` }
SUDN configuration for Special Use Domain Names
type SourceLoading ¶
type SourceLoading struct { Init `yaml:",inline"` Concurrency uint `yaml:"concurrency" default:"4"` MaxErrorsPerSource int `yaml:"maxErrorsPerSource" default:"5"` RefreshPeriod Duration `yaml:"refreshPeriod" default:"4h"` Downloads Downloader `yaml:"downloads"` }
func (*SourceLoading) LogConfig ¶
func (c *SourceLoading) LogConfig(logger *logrus.Entry)
func (*SourceLoading) StartPeriodicRefresh ¶
type TLSVersion ¶
type TLSVersion int // values MUST match `tls.VersionTLS*`
TLSVersion represents a TLS protocol version. ENUM( 1.0 = 769 1.1 1.2 1.3 )
const ( // TLSVersion10 is a TLSVersion of type 1.0. TLSVersion10 TLSVersion = iota + 769 // TLSVersion11 is a TLSVersion of type 1.1. TLSVersion11 // TLSVersion12 is a TLSVersion of type 1.2. TLSVersion12 // TLSVersion13 is a TLSVersion of type 1.3. TLSVersion13 )
func ParseTLSVersion ¶
func ParseTLSVersion(name string) (TLSVersion, error)
ParseTLSVersion attempts to convert a string to a TLSVersion.
func TLSVersionValues ¶
func TLSVersionValues() []TLSVersion
TLSVersionValues returns a list of the values for TLSVersion
func (TLSVersion) IsValid ¶
func (x TLSVersion) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (TLSVersion) MarshalText ¶
func (x TLSVersion) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (TLSVersion) String ¶
func (x TLSVersion) String() string
String implements the Stringer interface.
func (*TLSVersion) UnmarshalText ¶
func (x *TLSVersion) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type Upstream ¶
type Upstream struct { Net NetProtocol Host string Port uint16 Path string CommonName string // Common Name to use for certificate verification; optional. "" uses .Host }
Upstream is the definition of external DNS server
func ParseUpstream ¶
ParseUpstream creates new Upstream from passed string in format net:host[:port][/path][#commonname]
func (*Upstream) UnmarshalText ¶
UnmarshalText implements `encoding.TextUnmarshaler`.
type UpstreamGroup ¶
UpstreamGroup represents the config for one group (upstream branch)
func NewUpstreamGroup ¶
func NewUpstreamGroup(name string, cfg Upstreams, upstreams []Upstream) UpstreamGroup
NewUpstreamGroup creates an UpstreamGroup with the given name and upstreams.
The upstreams from `cfg.Groups` are ignored.
func (*UpstreamGroup) GroupUpstreams ¶
func (c *UpstreamGroup) GroupUpstreams() []Upstream
func (*UpstreamGroup) IsEnabled ¶
func (c *UpstreamGroup) IsEnabled() bool
IsEnabled implements `config.Configurable`.
func (*UpstreamGroup) LogConfig ¶
func (c *UpstreamGroup) LogConfig(logger *logrus.Entry)
LogConfig implements `config.Configurable`.
type UpstreamGroups ¶
type UpstreamStrategy ¶
type UpstreamStrategy uint8
UpstreamStrategy data field to be logged ENUM(parallel_best,strict,random)
const ( // UpstreamStrategyParallelBest is a UpstreamStrategy of type Parallel_best. UpstreamStrategyParallelBest UpstreamStrategy = iota // UpstreamStrategyStrict is a UpstreamStrategy of type Strict. UpstreamStrategyStrict // UpstreamStrategyRandom is a UpstreamStrategy of type Random. UpstreamStrategyRandom )
func ParseUpstreamStrategy ¶
func ParseUpstreamStrategy(name string) (UpstreamStrategy, error)
ParseUpstreamStrategy attempts to convert a string to a UpstreamStrategy.
func UpstreamStrategyValues ¶
func UpstreamStrategyValues() []UpstreamStrategy
UpstreamStrategyValues returns a list of the values for UpstreamStrategy
func (UpstreamStrategy) IsValid ¶
func (x UpstreamStrategy) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (UpstreamStrategy) MarshalText ¶
func (x UpstreamStrategy) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (UpstreamStrategy) String ¶
func (x UpstreamStrategy) String() string
String implements the Stringer interface.
func (*UpstreamStrategy) UnmarshalText ¶
func (x *UpstreamStrategy) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type Upstreams ¶
type Upstreams struct { Init Init `yaml:"init"` Timeout Duration `yaml:"timeout" default:"2s"` // always > 0 Groups UpstreamGroups `yaml:"groups"` Strategy UpstreamStrategy `yaml:"strategy" default:"parallel_best"` UserAgent string `yaml:"userAgent"` }
Upstreams upstream servers configuration
type ZoneFileDNS ¶
type ZoneFileDNS struct { RRs CustomDNSMapping // contains filtered or unexported fields }
func (*ZoneFileDNS) UnmarshalYAML ¶
func (z *ZoneFileDNS) UnmarshalYAML(unmarshal func(interface{}) error) error