cleanup(netx): remove the DNSClient type (#660)

The DNSClient type existed because the Resolver type did not
include CloseIdleConnections in its signature.

Now that Resolver includes CloseIdleConnections, the DNSClient
type has become unnecessary and can be safely removed.

See https://github.com/ooni/probe/issues/1956.
This commit is contained in:
Simone Basso
2022-01-10 11:53:06 +01:00
committed by GitHub
parent 730373cc75
commit d3c6c11e48
4 changed files with 36 additions and 58 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ import (
// Client is DNS, HTTP, and TCP client.
type Client struct {
dnsClient *netx.DNSClient
dnsClient model.Resolver
httpTransport model.HTTPTransport
dialer model.Dialer
}
@@ -34,7 +34,7 @@ func NewClient(resolverURL string) (*Client, error) {
return nil, err
}
return &Client{
dnsClient: &configuration.DNSClient,
dnsClient: configuration.DNSClient,
httpTransport: netx.NewHTTPTransport(configuration.HTTPConfig),
dialer: netx.NewDialer(configuration.HTTPConfig),
}, nil