Documentation ¶
Overview ¶
Package dnstest allows for easy testing of DNS client against a test server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiRecorder ¶
MultiRecorder is a type of ResponseWriter that captures all messages written to it.
func NewMultiRecorder ¶
func NewMultiRecorder(w dns.ResponseWriter) *MultiRecorder
NewMultiRecorder makes and returns a new MultiRecorder.
type Recorder ¶
Recorder is a type of ResponseWriter that captures the rcode code written to it and also the size of the message written in the response. A rcode code does not have to be written, however, in which case 0 must be assumed. It is best to have the constructor initialize this type with that default status code.
func NewRecorder ¶
func NewRecorder(w dns.ResponseWriter) *Recorder
NewRecorder makes and returns a new Recorder, which captures the DNS rcode from the ResponseWriter and also the length of the response message written through it.
type Server ¶
type Server struct { Addr string // Address where the server listening. // contains filtered or unexported fields }
A Server is an DNS server listening on a system-chosen port on the local loopback interface, for use in end-to-end DNS tests.
func NewServer ¶
func NewServer(f dns.HandlerFunc) *Server
NewServer starts and returns a new Server. The caller should call Close when finished, to shut it down.