Documentation ¶
Overview ¶
Package dnstest provides DNS testing utilities and convenience functions.
Index ¶
- func A(hdr dns.RR_Header, ip net.IP) *dns.A
- func AAAA(hdr dns.RR_Header, ip net.IP) *dns.AAAA
- func Message(opts ...MsgOpt) *dns.Msg
- func NS(hdr dns.RR_Header, ns string) *dns.NS
- func RRHeader(name string, rrtype uint16, ttl uint32) dns.RR_Header
- func SOA(hdr dns.RR_Header, ns, mbox string, minttl uint32) *dns.SOA
- func SRV(hdr dns.RR_Header, target string, port, priority, weight uint16) *dns.SRV
- type MsgOpt
- type ResponseRecorder
- func (r *ResponseRecorder) Close() error
- func (r *ResponseRecorder) Hijack()
- func (r ResponseRecorder) LocalAddr() net.Addr
- func (r ResponseRecorder) RemoteAddr() net.Addr
- func (r ResponseRecorder) TsigStatus() error
- func (r ResponseRecorder) TsigTimersOnly(bool)
- func (r *ResponseRecorder) Write([]byte) (int, error)
- func (r *ResponseRecorder) WriteMsg(m *dns.Msg) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RRHeader ¶
RRHeader returns a dns.RR_Header with the given arguments set as well as a few hard-coded defaults.
Types ¶
type MsgOpt ¶
A MsgOpt is functional option for dns.Msgs
func Header ¶
Header returns a MsgOpt that sets a dns.Msg's MsgHdr with the given arguments and some hard-coded defaults.
type ResponseRecorder ¶
ResponseRecorder implements the dns.ResponseWriter interface. It's used in tests only.
func (ResponseRecorder) LocalAddr ¶
func (r ResponseRecorder) LocalAddr() net.Addr
LocalAddr returns the internal Local net.IPAddr.
func (ResponseRecorder) RemoteAddr ¶
func (r ResponseRecorder) RemoteAddr() net.Addr
RemoteAddr returns the internal Remote net.IPAddr
func (ResponseRecorder) TsigStatus ¶
func (r ResponseRecorder) TsigStatus() error
TsigStatus is not implemented.
func (ResponseRecorder) TsigTimersOnly ¶
func (r ResponseRecorder) TsigTimersOnly(bool)
TsigTimersOnly is not implemented.
Click to show internal directories.
Click to hide internal directories.