local

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package local (aka internal/resolver/local) is a resolver implementation which handle local lookups via /etc/resolv.conf. It more-or-less implements res_send(3).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) (*local, error)

New is the constructor for a local resolver

Types

type Config

type Config struct {
	ResolvConfPath string
	LocalDomains   []string // In addition to those found in the resolvConfPath

	// Caller can create their own Exchangers on our behalf
	NewDNSClientExchangerFunc func(net string) DNSClientExchanger
}

Config is passed to the New() constructor.

type DNSClientExchanger

type DNSClientExchanger interface {
	Exchange(query *dns.Msg, server string) (reply *dns.Msg, rtt time.Duration, err error)
}

DNSClientExchanger is an interface which implements dns.Client.Exchange() - the only dns.Client method used by localresolver. It exists so we can supply a mock dns.Client for testing.

Jump to

Keyboard shortcuts

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