config

package
v0.9.2-0...-36b1380 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NetUDP UDP protocol (deprecated)
	NetUDP = "udp"

	// NetTCP TCP protocol (deprecated)
	NetTCP = "tcp"

	// NetTCPUDP TCP and UDP protocols
	NetTCPUDP = "tcp+udp"

	// NetTCPTLS TCP-TLS protocol
	NetTCPTLS = "tcp-tls"

	// NetHTTPS HTTPS protocol
	NetHTTPS = "https"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockingConfig

type BlockingConfig struct {
	BlackLists        map[string][]string `yaml:"blackLists"`
	WhiteLists        map[string][]string `yaml:"whiteLists"`
	ClientGroupsBlock map[string][]string `yaml:"clientGroupsBlock"`
	BlockType         string              `yaml:"blockType"`
	RefreshPeriod     int                 `yaml:"refreshPeriod"`
}

BlockingConfig configuration for query blocking

type CachingConfig

type CachingConfig struct {
	MinCachingTime int  `yaml:"minTime"`
	MaxCachingTime int  `yaml:"maxTime"`
	Prefetching    bool `yaml:"prefetching"`
}

CachingConfig configuration for domain caching

type ClientLookupConfig

type ClientLookupConfig struct {
	ClientnameIPMapping map[string][]net.IP `yaml:"clients"`
	Upstream            Upstream            `yaml:"upstream"`
	SingleNameOrder     []uint              `yaml:"singleNameOrder"`
}

ClientLookupConfig configuration for the client lookup

type ConditionalUpstreamConfig

type ConditionalUpstreamConfig struct {
	Rewrite map[string]string          `yaml:"rewrite"`
	Mapping ConditionalUpstreamMapping `yaml:"mapping"`
}

ConditionalUpstreamConfig conditional upstream configuration

type ConditionalUpstreamMapping

type ConditionalUpstreamMapping struct {
	Upstreams map[string][]Upstream
}

ConditionalUpstreamMapping mapping for conditional configuration

func (*ConditionalUpstreamMapping) UnmarshalYAML

func (c *ConditionalUpstreamMapping) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML creates ConditionalUpstreamMapping from YAML

type Config

type Config struct {
	Upstream     UpstreamConfig            `yaml:"upstream"`
	CustomDNS    CustomDNSConfig           `yaml:"customDNS"`
	Conditional  ConditionalUpstreamConfig `yaml:"conditional"`
	Blocking     BlockingConfig            `yaml:"blocking"`
	ClientLookup ClientLookupConfig        `yaml:"clientLookup"`
	Caching      CachingConfig             `yaml:"caching"`
	QueryLog     QueryLogConfig            `yaml:"queryLog"`
	Prometheus   PrometheusConfig          `yaml:"prometheus"`
	LogLevel     string                    `yaml:"logLevel"`
	LogFormat    string                    `yaml:"logFormat"`
	LogTimestamp bool                      `yaml:"logTimestamp"`
	Port         string                    `yaml:"port"`
	HTTPPort     uint16                    `yaml:"httpPort"`
	HTTPSPort    uint16                    `yaml:"httpsPort"`
	DisableIPv6  bool                      `yaml:"disableIPv6"`
	CertFile     string                    `yaml:"httpsCertFile"`
	KeyFile      string                    `yaml:"httpsKeyFile"`
	BootstrapDNS Upstream                  `yaml:"bootstrapDns"`
}

Config main configuration nolint:maligned

func NewConfig

func NewConfig(path string, mandatory bool) Config

NewConfig creates new config from YAML file

type CustomDNSConfig

type CustomDNSConfig struct {
	Mapping CustomDNSMapping `yaml:"mapping"`
}

CustomDNSConfig custom DNS configuration

type CustomDNSMapping

type CustomDNSMapping struct {
	HostIPs map[string][]net.IP
}

CustomDNSMapping mapping for the custom DNS configuration

func (*CustomDNSMapping) UnmarshalYAML

func (c *CustomDNSMapping) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML creates CustomDNSMapping from YAML

type PrometheusConfig

type PrometheusConfig struct {
	Enable bool   `yaml:"enable"`
	Path   string `yaml:"path"`
}

PrometheusConfig contains the config values for prometheus

type QueryLogConfig

type QueryLogConfig struct {
	Dir              string `yaml:"dir"`
	PerClient        bool   `yaml:"perClient"`
	LogRetentionDays uint64 `yaml:"logRetentionDays"`
}

QueryLogConfig configuration for the query logging

type Upstream

type Upstream struct {
	Net  string
	Host string
	Port uint16
	Path string
}

Upstream is the definition of external DNS server

func ParseUpstream

func ParseUpstream(upstream string) (result Upstream, err error)

ParseUpstream creates new Upstream from passed string in format net:host[:port][/path]

func (*Upstream) UnmarshalYAML

func (u *Upstream) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML creates Upstream from YAML

type UpstreamConfig

type UpstreamConfig struct {
	ExternalResolvers map[string][]Upstream `yaml:",inline"`
}

UpstreamConfig upstream server configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL