Documentation ¶
Overview ¶
DNS resolver for testing purposes.
In the future, when go fuzz can make use of _test.go files, we can rename this file dns_test.go and remove this extra package entirely. Until then, unfortunately this is the most reasonable way to share these helpers between go and fuzz tests.
Index ¶
- type TestResolver
- func (r *TestResolver) LookupAddr(ctx context.Context, host string) (addrs []string, err error)
- func (r *TestResolver) LookupIPAddr(ctx context.Context, host string) (as []net.IPAddr, err error)
- func (r *TestResolver) LookupMX(ctx context.Context, domain string) (mxs []*net.MX, err error)
- func (r *TestResolver) LookupTXT(ctx context.Context, domain string) (txts []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestResolver ¶
type TestResolver struct { Txt map[string][]string Mx map[string][]*net.MX Ip map[string][]net.IP Addr map[string][]string Cname map[string]string Errors map[string]error }
Testing DNS resolver.
Not exported since this is not part of the public API and only used internally on tests.
func NewResolver ¶
func NewResolver() *TestResolver
func (*TestResolver) LookupAddr ¶
func (*TestResolver) LookupIPAddr ¶
Click to show internal directories.
Click to hide internal directories.