@@ -22,18 +22,19 @@ var (
22
22
}
23
23
)
24
24
25
- // Querier is an interface for querying DNS records
25
+ // Querier is an interface for querying DNS records.
26
26
type Querier interface {
27
27
Query (domain string , qtype uint16 ) (* dns.Msg , error )
28
+ QueryTypes (domain string , qtypes []uint16 ) ([]* dns.Msg , error )
28
29
}
29
30
30
- // Query implements the Querier interface
31
+ // Query implements the Querier interface.
31
32
type Query struct {
32
33
Server string
33
34
hclog.Logger
34
35
}
35
36
36
- // NewQuerier creates a new Querier with the specified server
37
+ // NewQuerier creates a new Querier with the specified server.
37
38
func NewQuerier (server string , logger hclog.Logger ) Querier {
38
39
if logger == nil {
39
40
logger = hclog .New (& hclog.LoggerOptions {
@@ -47,7 +48,7 @@ func NewQuerier(server string, logger hclog.Logger) Querier {
47
48
return & Query {Server : server , Logger : logger }
48
49
}
49
50
50
- // QueryTypes performs DNS queries for multiple types concurrently
51
+ // QueryTypes performs DNS queries for multiple types concurrently.
51
52
func (q * Query ) QueryTypes (domain string , qtypes []uint16 ) ([]* dns.Msg , error ) {
52
53
var errors * multierror.Error
53
54
var wg sync.WaitGroup
@@ -68,7 +69,7 @@ func (q *Query) QueryTypes(domain string, qtypes []uint16) ([]*dns.Msg, error) {
68
69
return messages , errors .ErrorOrNil ()
69
70
}
70
71
71
- // Query performs the DNS query and returns the response and any error encountered
72
+ // Query performs the DNS query and returns the response and any error encountered.
72
73
func (q * Query ) Query (domain string , qtype uint16 ) (* dns.Msg , error ) {
73
74
msg := new (dns.Msg )
74
75
msg .SetQuestion (dns .Fqdn (domain ), qtype )
0 commit comments