configuration

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPrefetchDelay    time.Duration = 24 * time.Hour
	MinimumPrefetchInterval time.Duration = 6 * time.Hour
)
View Source
const CFG_Channels_Main = "main"
View Source
const (
	SourceFormatV2 = iota
)

Variables

This section is empty.

Functions

func ConfigLoad

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

func PrintInferfaceInfo

func PrintInferfaceInfo(name *string)

Types

type AnonymizedDNSConfig

type AnonymizedDNSConfig struct {
	Routes []AnonymizedDNSRouteConfig `toml:"routes"`
}

type AnonymizedDNSRouteConfig

type AnonymizedDNSRouteConfig struct {
	ServerName string   `toml:"server_name"`
	RelayNames []string `toml:"via"`
}

type Config

type Config struct {
	*Main
	ChannelsSections map[string]channels.Config `toml:"channels_sections"`
	SourcesConfig    map[string]SourceConfig    `toml:"sources"`
	AnonymizedDNS    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"`
}

type ListenerAssociation

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

type Main

type Main struct {
	LogLevel                 int                   `toml:"log_level"`
	LogFile                  *string               `toml:"log_file"`
	UseSyslog                bool                  `toml:"use_syslog"`
	ForceTCP                 bool                  `toml:"force_tcp"`
	TLSDisableSessionTickets bool                  `toml:"tls_disable_session_tickets"`
	NetprobeTimeout          int                   `toml:"netprobe_Timeout"`
	CertRefreshDelay         int                   `toml:"cert_refresh_delay"`
	Timeout                  int                   `toml:"timeout"`
	KeepAlive                int                   `toml:"keepalive"`
	ServerNames              []string              `toml:"server_names"`
	DisabledServerNames      []string              `toml:"disabled_server_names"`
	ListenAddresses          []string              `toml:"listen_addresses"`
	MaxClients               uint32                `toml:"max_clients"`
	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"`
	Occurrence               string                `toml:"occurrence"`
	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, XTransport *tls.XTransport, urls []string, minisignKeyStr string, cacheFile string, formatStr 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) ([]common.RegisteredServer, error)

type SourceConfig

type SourceConfig struct {
	URL            string
	URLs           []string
	MinisignKeyStr string `toml:"minisign_key"`
	CacheFile      string `toml:"cache_file"`
	FormatStr      string `toml:"format"`
	RefreshDelay   int    `toml:"refresh_delay"`
	Prefix         string
}

type SourceFormat

type SourceFormat int

Jump to

Keyboard shortcuts

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