Documentation
¶
Overview ¶
Package dnstest runs an in-process DNS server for tests, so code that resolves names goes through a real *net.Resolver (NXDOMAIN, SERVFAIL, multi-string TXT) instead of a hand-built stub.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Zone ¶
type Zone struct {
// contains filtered or unexported fields
}
Zone is an in-process DNS server whose TXT records a test edits while it runs, so a test publishes and withdraws a record (a Join domain's proof) between two calls of the code under test. Each Zone is its own server, so tests never share records.
func NewZone ¶
NewZone starts an empty zone: every name answers NXDOMAIN until a record is published. The server stops with the test.
func (*Zone) LookupTXT ¶
LookupTXT resolves through the zone's server; it satisfies sending.TXTLookup.
func (*Zone) PublishTXT ¶
PublishTXT adds a TXT record with value at name (no trailing dot needed).
func (*Zone) WithdrawTXT ¶
WithdrawTXT removes every TXT record at name.