localdns

package
v2.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debug(message string)
	Warn(message string)
}

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware implements a DNS forwarder for requests containing a single local name question.

func New

func New(settings Settings) (middleware *Middleware, err error)

func (*Middleware) Stop

func (m *Middleware) Stop() (err error)

Stop stops the middleware, and all wrapping DNS handlers created by the middleware will cease to handle requests. The function returns once all handlers are done with their previously ongoing ServeDNS calls.

func (*Middleware) String

func (m *Middleware) String() string

func (*Middleware) Wrap

func (m *Middleware) Wrap(next dns.Handler) dns.Handler

Wrap wraps the DNS handler with the middleware.

type Settings

type Settings struct {
	// Resolvers is the list of resolvers to use to resolve the
	// local domain names. They are each tried after the other
	// in order, until one returns an answer for the question.
	// If left empty, the local nameservers found are used.
	Resolvers []netip.AddrPort
	// Logger is the logger to use.
	// It defaults to a No-op implementation.
	Logger Logger
}

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (*Settings) String

func (s *Settings) String() string

func (*Settings) ToLinesNode

func (s *Settings) ToLinesNode() (node *gotree.Node)

func (*Settings) Validate

func (s *Settings) Validate() (err error)

Jump to

Keyboard shortcuts

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