config

package
v1.43.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultControl = "/var/run/nextdns.sock"

Variables

This section is empty.

Functions

func ParseBytes added in v1.5.0

func ParseBytes(s string) (uint64, error)

ParseBytes returns the number of bytes express using human notation like 1MB or 1.5GB.

Types

type Config added in v1.2.3

type Config struct {
	File                 string
	Listens              []string
	Control              string
	ConfigDeprecated     Profiles
	Profile              Profiles
	Forwarders           Forwarders
	LogQueries           bool
	CacheSize            string
	CacheMaxAge          time.Duration
	MaxTTL               time.Duration
	ReportClientInfo     bool
	DiscoveryDNS         string
	MDNS                 string
	DetectCaptivePortals bool
	BogusPriv            bool
	UseHosts             bool
	Timeout              time.Duration
	MaxInflightRequests  uint
	SetupRouter          bool
	AutoActivate         bool
	Debug                bool
}

func (*Config) Parse added in v1.2.3

func (c *Config) Parse(cmd string, args []string, useStorage bool)

func (*Config) Save added in v1.2.3

func (c *Config) Save() error

func (*Config) Write added in v1.2.3

func (c *Config) Write(w io.Writer) error

type Forwarders added in v1.2.3

type Forwarders []Resolver

Forwarders is a list of Resolver with rules.

func (*Forwarders) Get added in v1.2.3

func (f *Forwarders) Get(domain string) resolver.Resolver

Get returns the server matching the domain conditions.

func (*Forwarders) Resolve added in v1.2.3

func (f *Forwarders) Resolve(ctx context.Context, q query.Query, buf []byte) (int, resolver.ResolveInfo, error)

Resolve implements proxy.Resolver interface.

func (*Forwarders) Set added in v1.2.3

func (f *Forwarders) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface.

func (*Forwarders) String added in v1.2.3

func (f *Forwarders) String() string

String is the method to format the flag's value

func (*Forwarders) Strings added in v1.4.0

func (f *Forwarders) Strings() []string

type Profiles added in v1.39.0

type Profiles []profile

Profiles is a list of profile with rules.

func (*Profiles) Get added in v1.39.0

func (ps *Profiles) Get(sourceIP, destIP net.IP, mac net.HardwareAddr) string

Get returns the configuration matching the ip and mac conditions.

func (*Profiles) Set added in v1.39.0

func (ps *Profiles) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface.

func (*Profiles) String added in v1.39.0

func (ps *Profiles) String() string

String is the method to format the flag's value

func (*Profiles) Strings added in v1.39.0

func (ps *Profiles) Strings() []string

type Resolver added in v1.2.3

type Resolver struct {
	resolver.Resolver

	Domain string
	// contains filtered or unexported fields
}

Resolver defines a forwarder server with some optional conditions.

func (Resolver) Match added in v1.2.3

func (r Resolver) Match(domain string) bool

Match returns true if the rule matches domain.

func (Resolver) String added in v1.2.3

func (r Resolver) String() string

Jump to

Keyboard shortcuts

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