config

package
v0.0.0-...-54f910c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyConfig

type ProxyConfig struct {
	sync.RWMutex
	ListenAddr      []string
	Upstream        []resolver.Resolver
	UpstreamErr     int
	Cache           *cache.DNSCache
	CacheFlush      time.Duration
	BlockList       *blocklist.BlockList
	Acl             []net.IPNet
	Dns64           bool
	Dns64Prefix     net.IPNet
	Api             bool
	ApiBind         string
	StatsHandler    *statshandler.StatsHandler
	Refresh         bool
	RefreshInterval time.Duration
	Log             *logger.Logger
	UserConfig      *UserConfig
	Setuid          bool
	SetuidUid       int
	SetuidGid       int
}

func NewProxyConfig

func NewProxyConfig() *ProxyConfig

type UserConfig

type UserConfig struct {
	Listen             []string `json:"listen"`
	Upstream           []string `json:"upstream"`
	Acl                []string `json:"acl"`
	Block              []string `json:"block"`
	BlockDelete        []string `json:"block-delete"`
	Blocklist          []string `json:"blocklist"`
	BlocklistAAAA      []string `json:"blocklist-aaaa"`
	BlocklistFromHosts []string `json:"blocklist-from-hosts"`
	LocalRR            []string `json:"localrr"`
	LocalRRPtr         []string `json:"localrr-ptr"`
	Localzone          []string `json:"localzone"`
	Dns64              bool     `json:"dns64"`
	Dns64Prefix        string   `json:"dns64-prefix"`
	Api                bool     `json:"api"`
	ApiBind            string   `json:"api-bind"`
	Refresh            bool     `json:"refresh"`
	RefreshInterval    string   `json:"refresh-interval"`
	Debug              bool     `json:"debug"`
	Syslog             bool     `json:"syslog"`
	Discard            bool     `json:"discard"`
	Setuid             string   `json:"setuid"`
}

func NewUserConfig

func NewUserConfig() *UserConfig

func (*UserConfig) GetProxyConfig

func (user_config *UserConfig) GetProxyConfig(config *ProxyConfig) error

Generate config from user options

func (*UserConfig) UpdateBlockList

func (user_config *UserConfig) UpdateBlockList(bl *blocklist.BlockList) error

Jump to

Keyboard shortcuts

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