config

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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"`
	Global            map[string]bool     `yaml:"global"`
	BlockType         string              `yaml:"blockType"`
	RefreshPeriod     int                 `yaml:"refreshPeriod"`
}

type CachingConfig

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

type ClientLookupConfig

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

type CnameConfig

type CnameConfig struct {
	Groups            map[string]Groups   `yaml:"groups"`
	ClientGroupsBlock map[string][]string `yaml:"clientGroupsBlock"`
}

type ConditionalUpstreamConfig

type ConditionalUpstreamConfig struct {
	Mapping map[string]Upstream `yaml:"mapping"`
}

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"`
	LogFormat    string                    `yaml:"logFormat"`
	LogLevel     string                    `yaml:"logLevel"`
	Port         uint16                    `yaml:"port"`
	HTTPPort     uint16                    `yaml:"httpPort"`
	HTTPSPort    uint16                    `yaml:"httpsPort"`
	CertFile     string                    `yaml:"httpsCertFile"`
	KeyFile      string                    `yaml:"httpsKeyFile"`
	BootstrapDNS Upstream                  `yaml:"bootstrapDns"`
	Cname        CnameConfig               `yaml:"cname"`
}

main configuration

func NewConfig

func NewConfig(path string) Config

type CustomDNSConfig

type CustomDNSConfig struct {
	Mapping map[string]net.IP `yaml:"mapping"`
}

type Groups

type Groups struct {
	Domains []string `yaml:"domains"`
	Cname   string   `yaml:"cname"`
}

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"`
}

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

type UpstreamConfig

type UpstreamConfig struct {
	ExternalResolvers []Upstream `yaml:"externalResolvers"`
}

Jump to

Keyboard shortcuts

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