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) LookupSOA(host string) ([]string, error)
- func (r *DefaultResolver) LookupTXT(host string) ([]string, error)
- func (r *DefaultResolver) LookupWHOIS(domain 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 (r *MockResolver) LookupSOA(host string) ([]string, error)
- func (m *MockResolver) LookupTXT(host string) ([]string, error)
- func (r *MockResolver) LookupWHOIS(domain 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)
func (*DefaultResolver) LookupNS ¶
func (r *DefaultResolver) LookupNS(host string) ([]*net.NS, error)
func (*DefaultResolver) LookupSOA ¶ added in v0.0.2
func (r *DefaultResolver) LookupSOA(host string) ([]string, error)
LookupSOA performs SOA record lookup using miekg/dns
func (*DefaultResolver) LookupTXT ¶
func (r *DefaultResolver) LookupTXT(host string) ([]string, error)
func (*DefaultResolver) LookupWHOIS ¶ added in v0.0.2
func (r *DefaultResolver) LookupWHOIS(domain string) (string, error)
LookupWHOIS performs a WHOIS lookup using domainr/whois
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 struct used to simulate resolver behaviour for testing purposes
func (*MockResolver) LookupAddr ¶
func (m *MockResolver) LookupAddr(ip string) ([]string, error)
simulates reverse DNS lookup for testing
func (*MockResolver) LookupCNAME ¶
func (m *MockResolver) LookupCNAME(host string) (string, error)
simulates DNS lookup for CNAME records for testing
func (*MockResolver) LookupIP ¶
func (m *MockResolver) LookupIP(host string) ([]net.IP, error)
simulates DNS lookup for A or AAAA records for testing
func (*MockResolver) LookupMX ¶
func (m *MockResolver) LookupMX(host string) ([]*net.MX, error)
simulates DNS lookup for MX records for testing
func (*MockResolver) LookupNS ¶
func (m *MockResolver) LookupNS(host string) ([]*net.NS, error)
simulates DNS lookup for NS records for testing
func (*MockResolver) LookupSOA ¶ added in v0.0.2
func (r *MockResolver) LookupSOA(host string) ([]string, error)
func (*MockResolver) LookupTXT ¶
func (m *MockResolver) LookupTXT(host string) ([]string, error)
simulates DNS lookup for TXT records for testing
func (*MockResolver) LookupWHOIS ¶ added in v0.0.2
func (r *MockResolver) LookupWHOIS(domain string) (string, error)
type Resolver ¶
type Resolver interface { LookupAddr(ip string) ([]string, error) LookupIP(host string) ([]net.IP, error) LookupCNAME(host string) (string, error) LookupMX(host string) ([]*net.MX, error) LookupNS(host string) ([]*net.NS, error) LookupTXT(host string) ([]string, error) LookupSOA(host string) ([]string, error) LookupWHOIS(host string) (string, error) }
Click to show internal directories.
Click to hide internal directories.