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
commit 6d3a4f1db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
169 changed files with 575 additions and 671 deletions

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2021-09-05 13:54:20.84233 +0200 CEST m=+0.000203459
// 2021-09-28 12:05:21.914519 +0200 CEST m=+0.000179917
package ooapi
@ -16,7 +16,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/ooni/probe-cli/v3/internal/kvstore"
"github.com/ooni/probe-cli/v3/internal/netxlite/iox"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/ooapi/apimodel"
)
@ -42,7 +42,7 @@ func (h *handleClientCallCheckReportID) ServeHTTP(w http.ResponseWriter, r *http
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return
@ -135,7 +135,7 @@ func (h *handleClientCallCheckIn) ServeHTTP(w http.ResponseWriter, r *http.Reque
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return
@ -227,7 +227,7 @@ func (h *handleClientCallMeasurementMeta) ServeHTTP(w http.ResponseWriter, r *ht
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return
@ -320,7 +320,7 @@ func (h *handleClientCallTestHelpers) ServeHTTP(w http.ResponseWriter, r *http.R
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return
@ -435,7 +435,7 @@ func (h *handleClientCallPsiphonConfig) ServeHTTP(w http.ResponseWriter, r *http
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return
@ -550,7 +550,7 @@ func (h *handleClientCallTorTargets) ServeHTTP(w http.ResponseWriter, r *http.Re
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return
@ -643,7 +643,7 @@ func (h *handleClientCallURLs) ServeHTTP(w http.ResponseWriter, r *http.Request)
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return
@ -736,7 +736,7 @@ func (h *handleClientCallOpenReport) ServeHTTP(w http.ResponseWriter, r *http.Re
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return
@ -828,7 +828,7 @@ func (h *handleClientCallSubmitMeasurement) ServeHTTP(w http.ResponseWriter, r *
}
h.count++
if r.Body != nil {
data, err := iox.ReadAllContext(r.Context(), r.Body)
data, err := netxlite.ReadAllContext(r.Context(), r.Body)
if err != nil {
w.WriteHeader(400)
return