config

package
v0.0.0-...-4829b00 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FilePath                    string                `yaml:"-" json:"-"`
	BindAddress                 string                `yaml:"bindAddress" json:"bindAddress"`
	DebugHTTPAddress            string                `yaml:"debugHTTPAddress" json:"debugHTTPAddress"`
	DohEnabled                  bool                  `yaml:"dohEnabled" json:"dohEnabled"`
	PrimaryDNS                  []*common.DNSUpstream `yaml:"primaryDNS" json:"primaryDNS"`
	AlternativeDNS              []*common.DNSUpstream `yaml:"alternativeDNS" json:"alternativeDNS"`
	OnlyPrimaryDNS              bool                  `yaml:"onlyPrimaryDNS" json:"onlyPrimaryDNS"`
	IPv6UseAlternativeDNS       bool                  `yaml:"ipv6UseAlternativeDNS" json:"ipv6UseAlternativeDNS"`
	AlternativeDNSConcurrent    bool                  `yaml:"alternativeDNSConcurrent" json:"alternativeDNSConcurrent"`
	WhenPrimaryDNSAnswerNoneUse string                `yaml:"whenPrimaryDNSAnswerNoneUse" json:"whenPrimaryDNSAnswerNoneUse"`
	IPNetworkFile               struct {
		Primary     string `yaml:"primary" json:"primary"`
		Alternative string `yaml:"alternative" json:"alternative"`
	} `yaml:"ipNetworkFile" json:"ipNetworkFile"`
	DomainFile struct {
		Primary            string `yaml:"primary" json:"primary"`
		Alternative        string `yaml:"alternative" json:"alternative"`
		PrimaryMatcher     string `yaml:"primaryMatcher" json:"primaryMatcher"`
		AlternativeMatcher string `yaml:"alternativeMatcher" json:"alternativeMatcher"`
		Matcher            string `yaml:"matcher" json:"matcher"`
	} `yaml:"domainFile" json:"domainFile"`
	HostsFile struct {
		HostsFile string `yaml:"hostsFile" json:"hostsFile"`
		Finder    string `yaml:"finder" json:"finder"`
	} `yaml:"hostsFile" json:"hostsFile"`
	MinimumTTL                   int      `yaml:"minimumTTL" json:"minimumTTL"`
	DomainTTLFile                string   `yaml:"domainTTLFile" json:"domainTTLFile"`
	CacheSize                    int      `yaml:"cacheSize" json:"cacheSize"`
	CacheRedisUrl                string   `yaml:"cacheRedisUrl" json:"cacheRedisUrl"`
	CacheRedisConnectionPoolSize int      `yaml:"cacheRedisConnectionPoolSize" json:"cacheRedisConnectionPoolSize"`
	RejectQType                  []uint16 `yaml:"rejectQType" json:"rejectQType"`

	DomainTTLMap            map[string]uint32 `yaml:"-" json:"-"`
	DomainPrimaryList       matcher.Matcher   `yaml:"-" json:"-"`
	DomainAlternativeList   matcher.Matcher   `yaml:"-" json:"-"`
	IPNetworkPrimarySet     *common.IPSet     `yaml:"-" json:"-"`
	IPNetworkAlternativeSet *common.IPSet     `yaml:"-" json:"-"`
	Hosts                   *hosts.Hosts      `yaml:"-" json:"-"`
	Cache                   *cache.Cache      `yaml:"-" json:"-"`
}

func NewConfig

func NewConfig(configFile string) *Config

New config with config file and do some other initiate works

Jump to

Keyboard shortcuts

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