Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AXFRResponse ¶
type AXFRResponse struct {
Rcode int
}
AXFRResponse is what is set with the AxfrServer to define what the response will be for its AXFR request.
type AxfrServer ¶
type AxfrServer struct { Path string // contains filtered or unexported fields }
AxfrServer is a mock server designed for a single DNS axfr request, a dumb server which loads the zone from a file and sends it back. It checks as little as possible to do the job.
func (*AxfrServer) GetResponse ¶
func (t *AxfrServer) GetResponse() *AXFRResponse
GetResponse returns the current response as set
func (*AxfrServer) ServeDNS ¶
func (t *AxfrServer) ServeDNS(wtr dns.ResponseWriter, q *dns.Msg)
ServeDNS meets the interface definition for dns.Handler
func (*AxfrServer) SetResponse ¶
func (t *AxfrServer) SetResponse(r *AXFRResponse)
SetResponse sets a new response for the axfr query
type ExchangeResponse ¶
type ExchangeResponse struct { Ignore bool Truncated bool Rcode int Ns []dns.RR Answer []dns.RR Extra []dns.RR QueryCount int // Times mockDNSHandler served this mockExchangeResponse }
ExchangeResponse is set by the caller to inform the ExchangeServer what the next response should contain.
type ExchangeServer ¶
type ExchangeServer struct {
// contains filtered or unexported fields
}
ExchangeServer is a mock replacement for a miekg dns.Handler. Used only for tests. It's a dumb server which does nothing more than copies the ExchangeResponse values into the reply message. It never checks the input or anything like that.
func (*ExchangeServer) GetResponse ¶
func (t *ExchangeServer) GetResponse() *ExchangeResponse
GetResponse returns the current response as set
func (*ExchangeServer) ServeDNS ¶
func (t *ExchangeServer) ServeDNS(wtr dns.ResponseWriter, q *dns.Msg)
ServeDNS meets the interface definition for dns.Handler
func (*ExchangeServer) SetResponse ¶
func (t *ExchangeServer) SetResponse(r *ExchangeResponse)
SetResponse sets a new response for the next query