dnsmasq

package
v0.0.0-...-df76fe3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

AllMetrics is a list of all exported metrics.

Functions

func ExtractDnsmasqArgs

func ExtractDnsmasqArgs(cmdlineArgs *[]string) []string

ExtractDnsmasqArgs returns the arguments that appear after "--" in the the command line. This function will also remove "--" and subsequent arguments from cmdlineArgs.

func RunNanny

func RunNanny(sync config.Sync, opts RunNannyOpts, kubednsServer string)

RunNanny runs the nanny and handles configuration updates.

Types

type MetricName

type MetricName string

MetricName is a metric

const (
	// CacheHits from dnsmasq.
	CacheHits MetricName = "hits"
	// CacheMisses from dnsmasq
	CacheMisses MetricName = "misses"
	// CacheEvictions from dnsmasq
	CacheEvictions MetricName = "evictions"
	// CacheInsertions from dnsmasq
	CacheInsertions MetricName = "insertions"
	// CacheSize from dnsmasq
	CacheSize MetricName = "cachesize"
)

type Metrics

type Metrics map[MetricName]int64

Metrics exported by dnsmasq via *.bind CHAOS queries.

type MetricsClient

type MetricsClient interface {
	GetMetrics() (ret *Metrics, err error)
}

MetricsClient is a client used to obtain metrics from dnsmasq.

func NewMetricsClient

func NewMetricsClient(addr string, port int) MetricsClient

NewMetricsClient creates a new client for getting raw metrics from dnsmasq via the *.bind CHAOS TXT records. Note: this feature works for dnsmasq v2.76+, it is missing in older releases of the software.

type Nanny

type Nanny struct {
	Exec string

	ExitChannel chan error
	// contains filtered or unexported fields
}

Nanny encapsulates a dnsmasq process and manages its configuration.

func (*Nanny) Configure

func (n *Nanny) Configure(args []string, config *config.Config, kubednsServer string)

Configure the nanny. This must be called before Start(). kubednsServer is the address of the local kubedns instance used to do name resolution for non-IP names.

func (*Nanny) Kill

func (n *Nanny) Kill() error

Kill the running Nanny.

func (*Nanny) Start

func (n *Nanny) Start() error

Start the nanny.

type RunNannyOpts

type RunNannyOpts struct {
	// Location of the dnsmasq executable.
	DnsmasqExec string
	// Extra arguments to dnsmasq.
	DnsmasqArgs []string
	// Restart the daemon on ConfigMap changes.
	RestartOnChange bool
}

RunNannyOpts for running the nanny.

Jump to

Keyboard shortcuts

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