configuration

package
v1.2.18 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: LGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPrefetchDelay    time.Duration = 24 * time.Hour
	MinimumPrefetchInterval time.Duration = 6 * time.Hour
)

DO NOT DELETE IT, IT'S FUN

View Source
const CFG_Channels_Main = "main"
View Source
const CFG_Channels_SP = "sp"

Variables

This section is empty.

Functions

func ConfigLoad

func ConfigLoad(proxy *dns.Proxy, flags *ConfigFlags) error

Types

type Config

type Config struct {
	*Main
	NodesSections    nodes.Config                  `toml:"dns_nodes"`
	ChannelsSections map[string]channels.Config    `toml:"channels_sections"`
	SourcesConfig    map[string]nodes.SourceConfig `toml:"sources"`
	AnonymizedDNS    *nodes.AnonymizedDNSConfig    `toml:"anonymized_dns"`
}

type ConfigFlags

type ConfigFlags struct {
	Check      *bool
	ConfigFile *string
	Child      *bool
}

type GroupsConfig

type GroupsConfig struct {
	Name     string   `toml:"name"`
	Servers  []string `toml:"servers"`
	Tag      string   `toml:"tag"`
	Groups   []string `toml:"groups"`
	Priority bool     `toml:"priority"`
	Match    string   `toml:"match"`
	DNSSEC   bool     `toml:"dnssec"`
}

type ListenerAssociation

type ListenerAssociation struct {
	Position int    `toml:"position"`
	Group    string `toml:"group"`
	Regex    bool   `toml:"regex"`
	DNSSEC   bool   `toml:"dnssec"`
}

type Main

type Main struct {
	LogLevel        int                   `toml:"log_level"`
	LogFile         *string               `toml:"log_file"`
	UseSyslog       bool                  `toml:"use_syslog"`
	NetprobeTimeout int                   `toml:"netprobe_Timeout"`
	ListenAddresses []string              `toml:"listen_addresses"`
	ProxyURI        string                `toml:"proxy_uri"`
	ProxyIP         string                `toml:"proxy_ip"`
	LocalInterface  string                `toml:"network_interface"`
	NetprobeAddress string                `toml:"netprobe_address"`
	UserName        string                `toml:"user_name"`
	Groups          []GroupsConfig        `toml:"groups"`
	GroupsListener  []ListenerAssociation `toml:"listener_association"`
}

type Source

type Source struct {
	// contains filtered or unexported fields
}

func NewSource

func NewSource(name string, urls []string, minisignKeyStr string, cacheFile string, refreshDelay time.Duration) (source *Source, err error)

NewSource loads a new source using the given cacheFile and urls, ensuring it has a valid signature

func (*Source) Parse

func (source *Source) Parse(prefix string, hasher hash.Hash) ([]*common.RegisteredServer, error)

func (*Source) ReadFile added in v1.2.0

func (source *Source) ReadFile(now time.Time, hasher hash.Hash) (delay time.Duration, err error, in []byte)

Jump to

Keyboard shortcuts

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