config

package
v1.5.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenConfig

func GenConfig(p string) error

GenConfig generates a template config to path p.

Types

type BasicUpstreamConfig

type BasicUpstreamConfig struct {
	Addr        string `yaml:"addr"`
	Protocol    string `yaml:"protocol"`
	Socks5      string `yaml:"socks5"`
	Deduplicate bool   `yaml:"deduplicate"`

	EDNS0 struct {
		ClientSubnet string `yaml:"client_subnet"`
		OverwriteECS bool   `yaml:"overwrite_ecs"`
	} `yaml:"edns0"`

	TCP struct {
		IdleTimeout uint `yaml:"idle_timeout"`
	} `yaml:"tcp"`

	DoT struct {
		ServerName  string `yaml:"server_name"`
		IdleTimeout uint   `yaml:"idle_timeout"`
	} `yaml:"dot"`

	DoH struct {
		URL string `yaml:"url"`
	} `yaml:"doh"`

	// for test and experts only, we add `omitempty`
	InsecureSkipVerify bool `yaml:"insecure_skip_verify,omitempty"`
}

BasicUpstreamConfig is a basic config for a dns upstream.

type Config

type Config struct {
	Dispatcher struct {
		Bind       []string `yaml:"bind"`
		MaxUDPSize int      `yaml:"max_udp_size"`
	} `yaml:"dispatcher"`

	Upstream map[string]*UpstreamEntryConfig `yaml:"upstream"`
	Server   map[string]*BasicUpstreamConfig `yaml:"server"`

	CA struct {
		Path []string `yaml:"path"`
	} `yaml:"ca"`
}

Config is config

func LoadConfig

func LoadConfig(p string) (*Config, error)

LoadConfig loads a yaml config from path p.

type UpstreamEntryConfig

type UpstreamEntryConfig struct {
	ServerTag string `yaml:"server_tag"`
	Policies  struct {
		Query struct {
			UnhandlableTypes string `yaml:"unhandlable_types"`
			Domain           string `yaml:"domain"`
		} `yaml:"query"`
		Reply struct {
			ErrorRcode string `yaml:"error_rcode"`
			CNAME      string `yaml:"cname"`
			WithoutIP  string `yaml:"without_ip"`
			IP         string `yaml:"ip"`
		} `yaml:"reply"`
	} `yaml:"policies"`
}

UpstreamEntryConfig is a dns upstream.

Jump to

Keyboard shortcuts

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