dns_handler

package
v4.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultHandler

type DefaultHandler struct {
	// Logger is used for logging. A nil value will disable logging.
	Logger *zap.Logger
	Entry  executable_seq.Executable

	// QueryTimeout limits the timeout value of each query.
	// Default is defaultQueryTimeout.
	QueryTimeout time.Duration

	// RecursionAvailable sets the dns.Msg.RecursionAvailable flag globally.
	RecursionAvailable bool
}

func (*DefaultHandler) ServeDNS

ServeDNS implements Handler. If entry returns an error, a SERVFAIL response will be sent back to client. If concurrentLimit is reached, the query will block and wait available token until ctx is done.

type DummyServerHandler

type DummyServerHandler struct {
	T       *testing.T
	WantMsg *dns.Msg
	WantErr error
}

func (*DummyServerHandler) ServeDNS

type Handler

type Handler interface {
	// ServeDNS handles r and writes response to w.
	// Implements must not keep and use req after the ServeDNS returned.
	// ServeDNS should handle errors by itself and sends properly error responses
	// to clients.
	// If ServeDNS returns an error, caller considers that the error is associated
	// with the downstream connection and will close the downstream connection
	// immediately.
	ServeDNS(ctx context.Context, req *dns.Msg, w ResponseWriter, meta *query_context.RequestMeta) error
}

Handler handles dns query.

type ResponseWriter

type ResponseWriter interface {
	Write(m *dns.Msg) error
}

ResponseWriter can write msg to the client.

Jump to

Keyboard shortcuts

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