-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(netx): move dns transports in netxlite/dnsx (#503)
While there, modernize the way in which we run tests to avoid depending on the fake files scattered around the tree and to use some well defined mock structures instead. Part of ooni/probe#1591
- Loading branch information
1 parent
b3c36b5
commit 3cb782f
Showing
21 changed files
with
549 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package resolver | ||
|
||
import "github.com/ooni/probe-cli/v3/internal/netxlite/dnsx" | ||
|
||
// Variables that other packages expect to find here but have been | ||
// moved into the internal/netxlite/dnsx package. | ||
var ( | ||
NewSerialResolver = dnsx.NewSerialResolver | ||
NewDNSOverUDP = dnsx.NewDNSOverUDP | ||
NewDNSOverTCP = dnsx.NewDNSOverTCP | ||
NewDNSOverTLS = dnsx.NewDNSOverTLS | ||
NewDNSOverHTTPS = dnsx.NewDNSOverHTTPS | ||
NewDNSOverHTTPSWithHostOverride = dnsx.NewDNSOverHTTPSWithHostOverride | ||
) | ||
|
||
// Types that other packages expect to find here but have been | ||
// moved into the internal/netxlite/dnsx package. | ||
type ( | ||
DNSOverHTTPS = dnsx.DNSOverHTTPS | ||
DNSOverTCP = dnsx.DNSOverTCP | ||
DNSOverUDP = dnsx.DNSOverUDP | ||
MiekgEncoder = dnsx.MiekgEncoder | ||
MiekgDecoder = dnsx.MiekgDecoder | ||
RoundTripper = dnsx.RoundTripper | ||
SerialResolver = dnsx.SerialResolver | ||
Dialer = dnsx.Dialer | ||
DialContextFunc = dnsx.DialContextFunc | ||
) |
2 changes: 1 addition & 1 deletion
2
internal/engine/netx/resolver/decoder.go → internal/netxlite/dnsx/decoder.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package dnsx | ||
|
||
import ( | ||
"errors" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rnal/engine/netx/resolver/dnsoverhttps.go → internal/netxlite/dnsx/dnsoverhttps.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package dnsx | ||
|
||
import ( | ||
"bytes" | ||
|
2 changes: 1 addition & 1 deletion
2
...engine/netx/resolver/dnsoverhttps_test.go → internal/netxlite/dnsx/dnsoverhttps_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package dnsx | ||
|
||
import ( | ||
"bytes" | ||
|
2 changes: 1 addition & 1 deletion
2
internal/engine/netx/resolver/dnsovertcp.go → internal/netxlite/dnsx/dnsovertcp.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package dnsx | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
internal/engine/netx/resolver/dnsoverudp.go → internal/netxlite/dnsx/dnsoverudp.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package dnsx | ||
|
||
import ( | ||
"context" | ||
|
Oops, something went wrong.