refactor: merge dnsx and errorsx into netxlite (#517)

When preparing a tutorial for netxlite, I figured it is easier
to tell people "hey, this is the package you should use for all
low-level networking stuff" rather than introducing people to
a set of packages working together where some piece of functionality
is here and some other piece is there.

Part of https://github.com/ooni/probe/issues/1591
This commit is contained in:
Simone Basso
2021-09-28 12:42:01 +02:00
committed by GitHub
parent de130d249c
commit 6d3a4f1db8
169 changed files with 575 additions and 671 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/engine/model"
"github.com/ooni/probe-cli/v3/internal/engine/netx"
"github.com/ooni/probe-cli/v3/internal/engine/netx/archival"
"github.com/ooni/probe-cli/v3/internal/netxlite/errorsx"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/randx"
)
@@ -293,7 +293,7 @@ func RunMethod(ctx context.Context, config RunMethodConfig) {
count, err := conn.Read(data)
if err != nil {
// We expect this method to terminate w/ timeout
if err.Error() == errorsx.FailureGenericTimeoutError {
if err.Error() == netxlite.FailureGenericTimeoutError {
err = nil
}
result.Err = err
+2 -2
View File
@@ -12,7 +12,7 @@ import (
"github.com/ooni/probe-cli/v3/internal/engine/model"
"github.com/ooni/probe-cli/v3/internal/engine/netx"
"github.com/ooni/probe-cli/v3/internal/engine/netx/archival"
"github.com/ooni/probe-cli/v3/internal/netxlite/errorsx"
"github.com/ooni/probe-cli/v3/internal/netxlite"
)
func TestNewExperimentMeasurer(t *testing.T) {
@@ -97,7 +97,7 @@ func TestCancelledContext(t *testing.T) {
t.Fatal("unexpected FailureList length")
}
for _, failure := range tk.FailureList {
if *failure != errorsx.FailureInterrupted {
if *failure != netxlite.FailureInterrupted {
t.Fatal("unexpected failure")
}
}