Documentation ¶
Index ¶
- func PerformDNSLookups(resolver Resolver, domain string)
- func PerformReverseLookup(resolver Resolver, ip string)
- func TestPerformReverseLookup(t *testing.T)
- type DefaultResolver
- func (r *DefaultResolver) LookupAddr(ip string) ([]string, error)
- func (r *DefaultResolver) LookupCNAME(host string) (string, error)
- func (r *DefaultResolver) LookupIP(host string) ([]net.IP, error)
- func (r *DefaultResolver) LookupMX(host string) ([]*net.MX, error)
- func (r *DefaultResolver) LookupNS(host string) ([]*net.NS, error)
- func (r *DefaultResolver) LookupTXT(host string) ([]string, error)
- type MockResolver
- func (m *MockResolver) LookupAddr(ip string) ([]string, error)
- func (m *MockResolver) LookupCNAME(host string) (string, error)
- func (m *MockResolver) LookupIP(host string) ([]net.IP, error)
- func (m *MockResolver) LookupMX(host string) ([]*net.MX, error)
- func (m *MockResolver) LookupNS(host string) ([]*net.NS, error)
- func (m *MockResolver) LookupTXT(host string) ([]string, error)
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PerformDNSLookups ¶
func PerformReverseLookup ¶
Types ¶
type DefaultResolver ¶
type DefaultResolver struct{}
DefaultResolver uses Go's net package for lookups
func (*DefaultResolver) LookupAddr ¶
func (r *DefaultResolver) LookupAddr(ip string) ([]string, error)
func (*DefaultResolver) LookupCNAME ¶
func (r *DefaultResolver) LookupCNAME(host string) (string, error)
func (*DefaultResolver) LookupIP ¶
func (r *DefaultResolver) LookupIP(host string) ([]net.IP, error)
func (*DefaultResolver) LookupMX ¶
func (r *DefaultResolver) LookupMX(host string) ([]*net.MX, error)
type MockResolver ¶
type MockResolver struct { MockLookupAddr func(string) ([]string, error) MockLookupIP func(string) ([]net.IP, error) MockLookupCNAME func(string) (string, error) MockLookupMX func(string) ([]*net.MX, error) MockLookupNS func(string) ([]*net.NS, error) MockLookupTXT func(string) ([]string, error) }
MockResolver is a struct used to simulate resolver behavior for testing purposes.
func (*MockResolver) LookupAddr ¶
func (m *MockResolver) LookupAddr(ip string) ([]string, error)
LookupAddr simulates reverse DNS lookup for testing.
func (*MockResolver) LookupCNAME ¶
func (m *MockResolver) LookupCNAME(host string) (string, error)
LookupCNAME simulates DNS lookup for CNAME records for testing.
func (*MockResolver) LookupIP ¶
func (m *MockResolver) LookupIP(host string) ([]net.IP, error)
LookupIP simulates DNS lookup for A or AAAA records for testing.
func (*MockResolver) LookupMX ¶
func (m *MockResolver) LookupMX(host string) ([]*net.MX, error)
LookupMX simulates DNS lookup for MX records for testing.
Click to show internal directories.
Click to hide internal directories.