agent

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDefaults

func ApplyDefaults(cc *CoreConfig)

ApplyDefaults sets reasonable default config values on a CoreConfig if no value is set.

Port defaults to 5301. Forward.Addresses defaults to [1.1.1.1, 1.0.0.1] (cloudflare dns servers) Forward.ServerName defaults to cloudflare-dns.com (cloudflare dns servers)

func Lockdown added in v0.3.0

func Lockdown(cc *CoreConfig) error

Types

type CoreConfig

type CoreConfig struct {
	Port       int
	NoDebug    bool
	NoLog      bool
	Allows     []string
	AllowFile  string
	AllowDir   string
	Blocks     []string
	BlockFile  string
	BlockDir   string
	Suffix     []string
	SuffixFile string
	SuffixDir  string
	NoDefaults bool
	Forward    *Forward
}

CoreConfig contains donutdns configuration. It is used to generate CoreDNS (Caddy) style configuration blocks.

func ConfigFromEnv

func ConfigFromEnv(e env.Environment) *CoreConfig

ConfigFromEnv parses environment variables from e and creates a CoreConfig.

func (*CoreConfig) Generate

func (cc *CoreConfig) Generate() string

Generate a CoreDNS (Caddy) style configuration block as a string.

func (*CoreConfig) Log

func (cc *CoreConfig) Log(logger output.Info)

Log cc to plog.

type Forward

type Forward struct {
	Addresses  []string
	ServerName string
}

Forward contains DNS recursion configuration.

Jump to

Keyboard shortcuts

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