diff --git a/internal/bytecounter/dialer.go b/internal/bytecounter/dialer.go index 78265494e4..b016bf491f 100644 --- a/internal/bytecounter/dialer.go +++ b/internal/bytecounter/dialer.go @@ -14,7 +14,7 @@ import ( // MaybeWrapWithContextAwareDialer wraps the given dialer with a ContextAwareDialer // if the enabled argument is true and otherwise just returns the given dialer. // -// Bug +// # Bug // // This implementation cannot properly account for the bytes that are sent by // persistent connections, because they stick to the counters set when the diff --git a/internal/cmd/apitool/main.go b/internal/cmd/apitool/main.go index 9fc9c82443..b0a0f10210 100644 --- a/internal/cmd/apitool/main.go +++ b/internal/cmd/apitool/main.go @@ -17,11 +17,11 @@ import ( "sync/atomic" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/httpx" "github.com/ooni/probe-cli/v3/internal/kvstore" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" + "github.com/ooni/probe-cli/v3/internal/probeservices" "github.com/ooni/probe-cli/v3/internal/version" ) diff --git a/internal/cmd/oohelperd/http_test.go b/internal/cmd/oohelperd/http_test.go index 1685331982..83bc658d0f 100644 --- a/internal/cmd/oohelperd/http_test.go +++ b/internal/cmd/oohelperd/http_test.go @@ -145,30 +145,30 @@ func Test_httpMapFailure(t *testing.T) { func TestParseAltSvc(t *testing.T) { type altSvcTest struct { - name string + name string input http.Header - want string + want string } - tests := [] altSvcTest { - { - name: "standard", + tests := []altSvcTest{ + { + name: "standard", input: http.Header{"Alt-Svc": []string{`h3=":443"; ma=3600,h2=":443"; ma=3600`}}, - want: ":443", + want: ":443", }, { - name: "changed order", + name: "changed order", input: http.Header{"Alt-Svc": []string{`h2=":443"; ma=3600,h3=":443"; ma=3600`}}, - want: ":443", + want: ":443", }, { - name: "empty", + name: "empty", input: http.Header{"Alt-Svc": []string{""}}, - want: "", + want: "", }, { - name: "no h3", + name: "no h3", input: http.Header{"Alt-Svc": []string{`h2=":443"; ma=3600`}}, - want: "", + want: "", }, } diff --git a/internal/cmd/oonireport/oonireport.go b/internal/cmd/oonireport/oonireport.go index cd53d49a32..80dddb45ad 100644 --- a/internal/cmd/oonireport/oonireport.go +++ b/internal/cmd/oonireport/oonireport.go @@ -13,8 +13,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine" - "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/model" + "github.com/ooni/probe-cli/v3/internal/probeservices" "github.com/ooni/probe-cli/v3/internal/runtimex" "github.com/ooni/probe-cli/v3/internal/version" "github.com/pborman/getopt/v2" diff --git a/internal/engine/experiment.go b/internal/engine/experiment.go index 5aebcf14d4..5a850693ae 100644 --- a/internal/engine/experiment.go +++ b/internal/engine/experiment.go @@ -14,8 +14,8 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/bytecounter" - "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/model" + "github.com/ooni/probe-cli/v3/internal/probeservices" "github.com/ooni/probe-cli/v3/internal/runtimex" "github.com/ooni/probe-cli/v3/internal/version" ) diff --git a/internal/engine/experiment/dash/dash.go b/internal/engine/experiment/dash/dash.go index 8489286acc..491531808f 100644 --- a/internal/engine/experiment/dash/dash.go +++ b/internal/engine/experiment/dash/dash.go @@ -14,8 +14,8 @@ import ( "time" "github.com/montanaflynn/stats" - "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/humanize" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/dash/dash_test.go b/internal/engine/experiment/dash/dash_test.go index b2a910c323..f6530ed316 100644 --- a/internal/engine/experiment/dash/dash_test.go +++ b/internal/engine/experiment/dash/dash_test.go @@ -11,7 +11,7 @@ import ( "github.com/apex/log" "github.com/montanaflynn/stats" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/tracex" ) diff --git a/internal/engine/experiment/dnscheck/dnscheck.go b/internal/engine/experiment/dnscheck/dnscheck.go index 5d098930e8..4a9541d70d 100644 --- a/internal/engine/experiment/dnscheck/dnscheck.go +++ b/internal/engine/experiment/dnscheck/dnscheck.go @@ -15,7 +15,7 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/runtimex" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/dnscheck/dnscheck_test.go b/internal/engine/experiment/dnscheck/dnscheck_test.go index c217eb6717..f7beba6aee 100644 --- a/internal/engine/experiment/dnscheck/dnscheck_test.go +++ b/internal/engine/experiment/dnscheck/dnscheck_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/dnsping/dnsping_test.go b/internal/engine/experiment/dnsping/dnsping_test.go index 0a9ef50e97..bc03bea34d 100644 --- a/internal/engine/experiment/dnsping/dnsping_test.go +++ b/internal/engine/experiment/dnsping/dnsping_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/miekg/dns" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/runtimex" ) diff --git a/internal/engine/experiment/echcheck/measure_test.go b/internal/engine/experiment/echcheck/measure_test.go index e76237e70a..cebeecd6d9 100644 --- a/internal/engine/experiment/echcheck/measure_test.go +++ b/internal/engine/experiment/echcheck/measure_test.go @@ -3,7 +3,7 @@ package echcheck import ( "context" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "testing" ) diff --git a/internal/engine/experiment/example/example_test.go b/internal/engine/experiment/example/example_test.go index 29c28fa28b..753ee98c7e 100644 --- a/internal/engine/experiment/example/example_test.go +++ b/internal/engine/experiment/example/example_test.go @@ -8,7 +8,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/example" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/fbmessenger/fbmessenger_test.go b/internal/engine/experiment/fbmessenger/fbmessenger_test.go index fa631c30e9..75beee5192 100644 --- a/internal/engine/experiment/fbmessenger/fbmessenger_test.go +++ b/internal/engine/experiment/fbmessenger/fbmessenger_test.go @@ -9,7 +9,7 @@ import ( engine "github.com/ooni/probe-cli/v3/internal/engine" "github.com/ooni/probe-cli/v3/internal/engine/experiment/fbmessenger" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/hhfm/hhfm_test.go b/internal/engine/experiment/hhfm/hhfm_test.go index 157ab18d66..08fbd4b518 100644 --- a/internal/engine/experiment/hhfm/hhfm_test.go +++ b/internal/engine/experiment/hhfm/hhfm_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/ooni/probe-cli/v3/internal/engine/experiment/hhfm" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/hirl/hirl.go b/internal/engine/experiment/hirl/hirl.go index e4931d90cd..24ce9e662f 100644 --- a/internal/engine/experiment/hirl/hirl.go +++ b/internal/engine/experiment/hirl/hirl.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/randx" diff --git a/internal/engine/experiment/hirl/hirl_test.go b/internal/engine/experiment/hirl/hirl_test.go index 40fec23d79..569dbf0227 100644 --- a/internal/engine/experiment/hirl/hirl_test.go +++ b/internal/engine/experiment/hirl/hirl_test.go @@ -8,8 +8,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/hirl" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/httphostheader/httphostheader_test.go b/internal/engine/experiment/httphostheader/httphostheader_test.go index 2c9c556913..dd7a6c0365 100644 --- a/internal/engine/experiment/httphostheader/httphostheader_test.go +++ b/internal/engine/experiment/httphostheader/httphostheader_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/ndt7/ndt7_test.go b/internal/engine/experiment/ndt7/ndt7_test.go index 7da663ea24..e9d86f4b7d 100644 --- a/internal/engine/experiment/ndt7/ndt7_test.go +++ b/internal/engine/experiment/ndt7/ndt7_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" ) diff --git a/internal/engine/experiment/psiphon/psiphon_test.go b/internal/engine/experiment/psiphon/psiphon_test.go index e4277215c2..97d540637c 100644 --- a/internal/engine/experiment/psiphon/psiphon_test.go +++ b/internal/engine/experiment/psiphon/psiphon_test.go @@ -11,7 +11,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/psiphon" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/quicping/quicping_test.go b/internal/engine/experiment/quicping/quicping_test.go index 34a8023d81..c11a25d28a 100644 --- a/internal/engine/experiment/quicping/quicping_test.go +++ b/internal/engine/experiment/quicping/quicping_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/model/mocks" ) diff --git a/internal/engine/experiment/riseupvpn/riseupvpn_test.go b/internal/engine/experiment/riseupvpn/riseupvpn_test.go index 5ae46374c8..4cd6b84614 100644 --- a/internal/engine/experiment/riseupvpn/riseupvpn_test.go +++ b/internal/engine/experiment/riseupvpn/riseupvpn_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/ooni/probe-cli/v3/internal/engine/experiment/riseupvpn" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/run/run_test.go b/internal/engine/experiment/run/run_test.go index 6fb3fde99d..e44b924e96 100644 --- a/internal/engine/experiment/run/run_test.go +++ b/internal/engine/experiment/run/run_test.go @@ -8,7 +8,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/experiment/dnscheck" "github.com/ooni/probe-cli/v3/internal/engine/experiment/run" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/signal/signal_test.go b/internal/engine/experiment/signal/signal_test.go index f78e859d5e..fae2a62e59 100644 --- a/internal/engine/experiment/signal/signal_test.go +++ b/internal/engine/experiment/signal/signal_test.go @@ -7,7 +7,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/signal" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" ) diff --git a/internal/engine/experiment/simplequicping/simplequicping_test.go b/internal/engine/experiment/simplequicping/simplequicping_test.go index 12bd5ced39..808d21ca9c 100644 --- a/internal/engine/experiment/simplequicping/simplequicping_test.go +++ b/internal/engine/experiment/simplequicping/simplequicping_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/lucas-clemente/quic-go" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/sniblocking/sniblocking_test.go b/internal/engine/experiment/sniblocking/sniblocking_test.go index 7424fbfeb9..6c3a19fc73 100644 --- a/internal/engine/experiment/sniblocking/sniblocking_test.go +++ b/internal/engine/experiment/sniblocking/sniblocking_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" ) diff --git a/internal/engine/experiment/stunreachability/stunreachability.go b/internal/engine/experiment/stunreachability/stunreachability.go index 870500fd91..8ab360ea87 100644 --- a/internal/engine/experiment/stunreachability/stunreachability.go +++ b/internal/engine/experiment/stunreachability/stunreachability.go @@ -10,7 +10,7 @@ import ( "net/url" "time" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/stunreachability/stunreachability_test.go b/internal/engine/experiment/stunreachability/stunreachability_test.go index 209fd18d30..b7b1acffd4 100644 --- a/internal/engine/experiment/stunreachability/stunreachability_test.go +++ b/internal/engine/experiment/stunreachability/stunreachability_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/pion/stun" diff --git a/internal/engine/experiment/tcpping/tcpping_test.go b/internal/engine/experiment/tcpping/tcpping_test.go index 330b9cbe18..fbb4c174d8 100644 --- a/internal/engine/experiment/tcpping/tcpping_test.go +++ b/internal/engine/experiment/tcpping/tcpping_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/telegram/telegram_test.go b/internal/engine/experiment/telegram/telegram_test.go index 704e7d8118..7f3a410217 100644 --- a/internal/engine/experiment/telegram/telegram_test.go +++ b/internal/engine/experiment/telegram/telegram_test.go @@ -8,7 +8,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/experiment/telegram" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" ) diff --git a/internal/engine/experiment/tlsping/tlsping_test.go b/internal/engine/experiment/tlsping/tlsping_test.go index fad4388104..48cff77807 100644 --- a/internal/engine/experiment/tlsping/tlsping_test.go +++ b/internal/engine/experiment/tlsping/tlsping_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/tlstool/internal/internal_test.go b/internal/engine/experiment/tlstool/internal/internal_test.go index b5b6df0b35..930609bd28 100644 --- a/internal/engine/experiment/tlstool/internal/internal_test.go +++ b/internal/engine/experiment/tlstool/internal/internal_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/ooni/probe-cli/v3/internal/engine/experiment/tlstool/internal" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/tlstool/internal/writer.go b/internal/engine/experiment/tlstool/internal/writer.go index e778631974..3d0440ecf4 100644 --- a/internal/engine/experiment/tlstool/internal/writer.go +++ b/internal/engine/experiment/tlstool/internal/writer.go @@ -20,7 +20,7 @@ func (c SleeperWriter) Write(b []byte) (int, error) { // SplitterWriter is a writer that splits every outgoing buffer // according to the rules specified by the Splitter. // -// Caveat +// # Caveat // // The TLS ClientHello may be retransmitted if the server is // requesting us to restart the negotiation. Therefore, it is diff --git a/internal/engine/experiment/tlstool/tlstool.go b/internal/engine/experiment/tlstool/tlstool.go index 9791b2a564..f2fc6ea325 100644 --- a/internal/engine/experiment/tlstool/tlstool.go +++ b/internal/engine/experiment/tlstool/tlstool.go @@ -2,7 +2,7 @@ // for running quick and dirty experiments. This tool will change // without notice and may be removed without notice. // -// Caveats +// # Caveats // // In particular, this experiment MAY panic when passed incorrect // input. This is acceptable because this is not production ready code. @@ -16,7 +16,7 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/experiment/tlstool/internal" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/runtimex" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/tlstool/tlstool_test.go b/internal/engine/experiment/tlstool/tlstool_test.go index 55a33bc76c..28868098a8 100644 --- a/internal/engine/experiment/tlstool/tlstool_test.go +++ b/internal/engine/experiment/tlstool/tlstool_test.go @@ -6,7 +6,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/tlstool" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/tor/tor_test.go b/internal/engine/experiment/tor/tor_test.go index 4e02549c2e..9ce8290f81 100644 --- a/internal/engine/experiment/tor/tor_test.go +++ b/internal/engine/experiment/tor/tor_test.go @@ -13,7 +13,7 @@ import ( "github.com/apex/log" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/measurex" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" diff --git a/internal/engine/experiment/torsf/integration_test.go b/internal/engine/experiment/torsf/integration_test.go index 11e846d3b8..2e6470699d 100644 --- a/internal/engine/experiment/torsf/integration_test.go +++ b/internal/engine/experiment/torsf/integration_test.go @@ -7,7 +7,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/torsf" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "golang.org/x/sys/execabs" ) diff --git a/internal/engine/experiment/torsf/torsf_test.go b/internal/engine/experiment/torsf/torsf_test.go index ee2fb02201..4401b11533 100644 --- a/internal/engine/experiment/torsf/torsf_test.go +++ b/internal/engine/experiment/torsf/torsf_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/ptx" "github.com/ooni/probe-cli/v3/internal/tunnel" diff --git a/internal/engine/experiment/urlgetter/configurer.go b/internal/engine/experiment/urlgetter/configurer.go index af39e24a78..12264317c7 100644 --- a/internal/engine/experiment/urlgetter/configurer.go +++ b/internal/engine/experiment/urlgetter/configurer.go @@ -8,7 +8,7 @@ import ( "regexp" "strings" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/tracex" diff --git a/internal/engine/experiment/urlgetter/getter_integration_test.go b/internal/engine/experiment/urlgetter/getter_integration_test.go index 402b6b8839..466ac0c8b5 100644 --- a/internal/engine/experiment/urlgetter/getter_integration_test.go +++ b/internal/engine/experiment/urlgetter/getter_integration_test.go @@ -10,7 +10,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/netxlite" ) diff --git a/internal/engine/experiment/urlgetter/getter_test.go b/internal/engine/experiment/urlgetter/getter_test.go index d862db52b5..94d443a471 100644 --- a/internal/engine/experiment/urlgetter/getter_test.go +++ b/internal/engine/experiment/urlgetter/getter_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" ) func TestGetterHTTPSWithTunnelCannotCreateTempDir(t *testing.T) { diff --git a/internal/engine/experiment/urlgetter/multi_test.go b/internal/engine/experiment/urlgetter/multi_test.go index 1b1b3a6712..6569814469 100644 --- a/internal/engine/experiment/urlgetter/multi_test.go +++ b/internal/engine/experiment/urlgetter/multi_test.go @@ -12,7 +12,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/urlgetter/runner.go b/internal/engine/experiment/urlgetter/runner.go index d88c03ff44..825160754d 100644 --- a/internal/engine/experiment/urlgetter/runner.go +++ b/internal/engine/experiment/urlgetter/runner.go @@ -9,7 +9,7 @@ import ( "net/http/cookiejar" "net/url" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/runtimex" diff --git a/internal/engine/experiment/urlgetter/urlgetter_test.go b/internal/engine/experiment/urlgetter/urlgetter_test.go index f9e62dae75..9e4427bcab 100644 --- a/internal/engine/experiment/urlgetter/urlgetter_test.go +++ b/internal/engine/experiment/urlgetter/urlgetter_test.go @@ -7,7 +7,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment/vanillator/integration_test.go b/internal/engine/experiment/vanillator/integration_test.go index c86ae9ec48..62c53dd1f4 100644 --- a/internal/engine/experiment/vanillator/integration_test.go +++ b/internal/engine/experiment/vanillator/integration_test.go @@ -7,7 +7,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/vanillator" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "golang.org/x/sys/execabs" ) diff --git a/internal/engine/experiment/vanillator/vanillator_test.go b/internal/engine/experiment/vanillator/vanillator_test.go index 91ef579b65..87eee4376c 100644 --- a/internal/engine/experiment/vanillator/vanillator_test.go +++ b/internal/engine/experiment/vanillator/vanillator_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/tunnel" "github.com/ooni/probe-cli/v3/internal/tunnel/mocks" diff --git a/internal/engine/experiment/whatsapp/whatsapp_test.go b/internal/engine/experiment/whatsapp/whatsapp_test.go index 8fe7938e1d..bcba4c1082 100644 --- a/internal/engine/experiment/whatsapp/whatsapp_test.go +++ b/internal/engine/experiment/whatsapp/whatsapp_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" "github.com/ooni/probe-cli/v3/internal/engine/experiment/whatsapp" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/experiment_test.go b/internal/engine/experiment_test.go index d7b985363e..84298039fb 100644 --- a/internal/engine/experiment_test.go +++ b/internal/engine/experiment_test.go @@ -3,7 +3,7 @@ package engine import ( "testing" - "github.com/ooni/probe-cli/v3/internal/engine/geolocate" + "github.com/ooni/probe-cli/v3/internal/geolocate" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/session.go b/internal/engine/session.go index 11817d9353..e0fb9bf600 100644 --- a/internal/engine/session.go +++ b/internal/engine/session.go @@ -12,14 +12,14 @@ import ( "sync/atomic" "github.com/ooni/probe-cli/v3/internal/bytecounter" - "github.com/ooni/probe-cli/v3/internal/engine/geolocate" - "github.com/ooni/probe-cli/v3/internal/engine/probeservices" - "github.com/ooni/probe-cli/v3/internal/engine/sessionresolver" + "github.com/ooni/probe-cli/v3/internal/geolocate" "github.com/ooni/probe-cli/v3/internal/kvstore" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" "github.com/ooni/probe-cli/v3/internal/platform" + "github.com/ooni/probe-cli/v3/internal/probeservices" "github.com/ooni/probe-cli/v3/internal/runtimex" + "github.com/ooni/probe-cli/v3/internal/sessionresolver" "github.com/ooni/probe-cli/v3/internal/tunnel" "github.com/ooni/probe-cli/v3/internal/version" ) diff --git a/internal/engine/session_integration_test.go b/internal/engine/session_integration_test.go index 9bc2c354bd..8a0b941b61 100644 --- a/internal/engine/session_integration_test.go +++ b/internal/engine/session_integration_test.go @@ -13,9 +13,9 @@ import ( "github.com/apex/log" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" + "github.com/ooni/probe-cli/v3/internal/probeservices" "github.com/ooni/probe-cli/v3/internal/version" ) diff --git a/internal/engine/session_internal_test.go b/internal/engine/session_internal_test.go index cd28c7c977..810dc6b340 100644 --- a/internal/engine/session_internal_test.go +++ b/internal/engine/session_internal_test.go @@ -9,7 +9,7 @@ import ( "github.com/apex/log" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/geolocate" + "github.com/ooni/probe-cli/v3/internal/geolocate" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/experiment/webconnectivitylte/analysiscore.go b/internal/experiment/webconnectivitylte/analysiscore.go index 35c91a3bb6..b68159f4c8 100644 --- a/internal/experiment/webconnectivitylte/analysiscore.go +++ b/internal/experiment/webconnectivitylte/analysiscore.go @@ -50,15 +50,15 @@ const ( // Originally, Web Connectivity only had a blocking scalar value so // we could see ourselves in one of the following cases: // -// +----------+------------+--------------------------+ -// | Blocking | Accessible | Meaning | -// +----------+------------+--------------------------+ -// | null | null | Probe analysis error | -// +----------+------------+--------------------------+ -// | false | true | We detected no blocking | -// +----------+------------+--------------------------+ -// | "..." | false | We detected blocking | -// +----------+------------+--------------------------+ +// +----------+------------+--------------------------+ +// | Blocking | Accessible | Meaning | +// +----------+------------+--------------------------+ +// | null | null | Probe analysis error | +// +----------+------------+--------------------------+ +// | false | true | We detected no blocking | +// +----------+------------+--------------------------+ +// | "..." | false | We detected blocking | +// +----------+------------+--------------------------+ // // While it would be possible in this implementation, which has a granular // definition of blocking (x_blocking_flags), to set accessible to mean @@ -73,21 +73,21 @@ const ( // Accordingly, this is how we map the value of the .XBlockingFlags to the // values of .Blocking and .Accessible: // -// +--------------------------------------+----------------+-------------+ -// | .BlockingFlags | .Blocking | .Accessible | -// +--------------------------------------+----------------+-------------+ -// | (& DNSBlocking) != 0 | "dns" | false | -// +--------------------------------------+----------------+-------------+ -// | (& TCPIPBlocking) != 0 | "tcp_ip" | false | -// +--------------------------------------+----------------+-------------+ -// | (& (TLSBlocking|HTTPBlocking)) != 0 | "http-failure" | false | -// +--------------------------------------+----------------+-------------+ -// | (& HTTPDiff) != 0 | "http-diff" | false | -// +--------------------------------------+----------------+-------------+ -// | == FlagSuccess | false | true | -// +--------------------------------------+----------------+-------------+ -// | otherwise | null | null | -// +--------------------------------------+----------------+-------------+ +// +--------------------------------------+----------------+-------------+ +// | .BlockingFlags | .Blocking | .Accessible | +// +--------------------------------------+----------------+-------------+ +// | (& DNSBlocking) != 0 | "dns" | false | +// +--------------------------------------+----------------+-------------+ +// | (& TCPIPBlocking) != 0 | "tcp_ip" | false | +// +--------------------------------------+----------------+-------------+ +// | (& (TLSBlocking|HTTPBlocking)) != 0 | "http-failure" | false | +// +--------------------------------------+----------------+-------------+ +// | (& HTTPDiff) != 0 | "http-diff" | false | +// +--------------------------------------+----------------+-------------+ +// | == FlagSuccess | false | true | +// +--------------------------------------+----------------+-------------+ +// | otherwise | null | null | +// +--------------------------------------+----------------+-------------+ // // It's a very simple rule, that should preserve previous semantics. // diff --git a/internal/experiment/webconnectivitylte/analysisdns.go b/internal/experiment/webconnectivitylte/analysisdns.go index c28f315854..2577115b0e 100644 --- a/internal/experiment/webconnectivitylte/analysisdns.go +++ b/internal/experiment/webconnectivitylte/analysisdns.go @@ -45,13 +45,13 @@ const ( // From the XDNSFlags value, we determine, in turn DNSConsistency and // XBlockingFlags according to the following decision table: // -// +-----------+----------------+---------------------+ -// | XDNSFlags | DNSConsistency | XBlockingFlags | -// +-----------+----------------+---------------------+ -// | 0 | "consistent" | no change | -// +-----------+----------------+---------------------+ -// | nonzero | "inconsistent" | set FlagDNSBlocking | -// +-----------+----------------+---------------------+ +// +-----------+----------------+---------------------+ +// | XDNSFlags | DNSConsistency | XBlockingFlags | +// +-----------+----------------+---------------------+ +// | 0 | "consistent" | no change | +// +-----------+----------------+---------------------+ +// | nonzero | "inconsistent" | set FlagDNSBlocking | +// +-----------+----------------+---------------------+ // // We explain how XDNSFlags is determined in the documentation of // the functions that this function calls to do its job. diff --git a/internal/engine/geolocate/cloudflare.go b/internal/geolocate/cloudflare.go similarity index 100% rename from internal/engine/geolocate/cloudflare.go rename to internal/geolocate/cloudflare.go diff --git a/internal/engine/geolocate/cloudflare_test.go b/internal/geolocate/cloudflare_test.go similarity index 100% rename from internal/engine/geolocate/cloudflare_test.go rename to internal/geolocate/cloudflare_test.go diff --git a/internal/engine/geolocate/fake_test.go b/internal/geolocate/fake_test.go similarity index 100% rename from internal/engine/geolocate/fake_test.go rename to internal/geolocate/fake_test.go diff --git a/internal/engine/geolocate/geolocate.go b/internal/geolocate/geolocate.go similarity index 100% rename from internal/engine/geolocate/geolocate.go rename to internal/geolocate/geolocate.go diff --git a/internal/engine/geolocate/geolocate_test.go b/internal/geolocate/geolocate_test.go similarity index 100% rename from internal/engine/geolocate/geolocate_test.go rename to internal/geolocate/geolocate_test.go diff --git a/internal/engine/geolocate/invalid_test.go b/internal/geolocate/invalid_test.go similarity index 100% rename from internal/engine/geolocate/invalid_test.go rename to internal/geolocate/invalid_test.go diff --git a/internal/engine/geolocate/iplookup.go b/internal/geolocate/iplookup.go similarity index 100% rename from internal/engine/geolocate/iplookup.go rename to internal/geolocate/iplookup.go diff --git a/internal/engine/geolocate/iplookup_test.go b/internal/geolocate/iplookup_test.go similarity index 100% rename from internal/engine/geolocate/iplookup_test.go rename to internal/geolocate/iplookup_test.go diff --git a/internal/engine/geolocate/mmdblookup.go b/internal/geolocate/mmdblookup.go similarity index 100% rename from internal/engine/geolocate/mmdblookup.go rename to internal/geolocate/mmdblookup.go diff --git a/internal/engine/geolocate/resolverlookup.go b/internal/geolocate/resolverlookup.go similarity index 100% rename from internal/engine/geolocate/resolverlookup.go rename to internal/geolocate/resolverlookup.go diff --git a/internal/engine/geolocate/resolverlookup_test.go b/internal/geolocate/resolverlookup_test.go similarity index 100% rename from internal/engine/geolocate/resolverlookup_test.go rename to internal/geolocate/resolverlookup_test.go diff --git a/internal/engine/geolocate/stun.go b/internal/geolocate/stun.go similarity index 100% rename from internal/engine/geolocate/stun.go rename to internal/geolocate/stun.go diff --git a/internal/engine/geolocate/stun_test.go b/internal/geolocate/stun_test.go similarity index 100% rename from internal/engine/geolocate/stun_test.go rename to internal/geolocate/stun_test.go diff --git a/internal/engine/geolocate/ubuntu.go b/internal/geolocate/ubuntu.go similarity index 100% rename from internal/engine/geolocate/ubuntu.go rename to internal/geolocate/ubuntu.go diff --git a/internal/engine/geolocate/ubuntu_test.go b/internal/geolocate/ubuntu_test.go similarity index 100% rename from internal/engine/geolocate/ubuntu_test.go rename to internal/geolocate/ubuntu_test.go diff --git a/internal/engine/mockable/mockable.go b/internal/legacy/mockable/mockable.go similarity index 100% rename from internal/engine/mockable/mockable.go rename to internal/legacy/mockable/mockable.go diff --git a/internal/engine/netx/config.go b/internal/legacy/netx/config.go similarity index 100% rename from internal/engine/netx/config.go rename to internal/legacy/netx/config.go diff --git a/internal/engine/netx/dialer.go b/internal/legacy/netx/dialer.go similarity index 100% rename from internal/engine/netx/dialer.go rename to internal/legacy/netx/dialer.go diff --git a/internal/engine/netx/dnstransport.go b/internal/legacy/netx/dnstransport.go similarity index 98% rename from internal/engine/netx/dnstransport.go rename to internal/legacy/netx/dnstransport.go index a19f1ff92d..dd5f6f3d3e 100644 --- a/internal/engine/netx/dnstransport.go +++ b/internal/legacy/netx/dnstransport.go @@ -27,7 +27,7 @@ import ( // - if the URL is `doh://google` or `doh://cloudflare` or the URL // starts with `https://`, then we create a DoH client. // -// - if the URL is `` or `system:///`, then we create a system client, +// - if the URL is `""` or `"system:///"`, then we create a system client, // i.e. a client using the system resolver. // // - if the URL starts with `udp://`, then we create a client using diff --git a/internal/engine/netx/dnstransport_test.go b/internal/legacy/netx/dnstransport_test.go similarity index 100% rename from internal/engine/netx/dnstransport_test.go rename to internal/legacy/netx/dnstransport_test.go diff --git a/internal/engine/netx/doc.go b/internal/legacy/netx/doc.go similarity index 100% rename from internal/engine/netx/doc.go rename to internal/legacy/netx/doc.go diff --git a/internal/engine/netx/http.go b/internal/legacy/netx/http.go similarity index 100% rename from internal/engine/netx/http.go rename to internal/legacy/netx/http.go diff --git a/internal/engine/netx/http_test.go b/internal/legacy/netx/http_test.go similarity index 100% rename from internal/engine/netx/http_test.go rename to internal/legacy/netx/http_test.go diff --git a/internal/engine/netx/integration_test.go b/internal/legacy/netx/integration_test.go similarity index 100% rename from internal/engine/netx/integration_test.go rename to internal/legacy/netx/integration_test.go diff --git a/internal/engine/netx/quic.go b/internal/legacy/netx/quic.go similarity index 100% rename from internal/engine/netx/quic.go rename to internal/legacy/netx/quic.go diff --git a/internal/engine/netx/resolver.go b/internal/legacy/netx/resolver.go similarity index 100% rename from internal/engine/netx/resolver.go rename to internal/legacy/netx/resolver.go diff --git a/internal/engine/netx/resolver_test.go b/internal/legacy/netx/resolver_test.go similarity index 100% rename from internal/engine/netx/resolver_test.go rename to internal/legacy/netx/resolver_test.go diff --git a/internal/engine/netx/tls.go b/internal/legacy/netx/tls.go similarity index 100% rename from internal/engine/netx/tls.go rename to internal/legacy/netx/tls.go diff --git a/internal/engine/netx/tls_test.go b/internal/legacy/netx/tls_test.go similarity index 100% rename from internal/engine/netx/tls_test.go rename to internal/legacy/netx/tls_test.go diff --git a/internal/measurexlite/trace.go b/internal/measurexlite/trace.go index 5d651f7120..0404850ebf 100644 --- a/internal/measurexlite/trace.go +++ b/internal/measurexlite/trace.go @@ -17,7 +17,7 @@ import ( // The zero-value of this struct is invalid. To construct you should either // fill all the fields marked as MANDATORY or use NewTrace. // -// Buffered channels +// # Buffered channels // // NewTrace uses reasonable buffer sizes for the channels used for collecting // events. You should drain the channels used by this implementation after diff --git a/internal/model/doc.go b/internal/model/doc.go index b1242d26d7..efeed58d88 100644 --- a/internal/model/doc.go +++ b/internal/model/doc.go @@ -1,6 +1,6 @@ // Package model contains the shared interfaces and data structures. // -// Criteria for adding a type to this package +// # Criteria for adding a type to this package // // This package should contain two types: // @@ -15,7 +15,7 @@ // this logic is strictly related to data structures and we // cannot implement this logic elsewhere. // -// Content of this package +// # Content of this package // // The following list (which may not always be up-to-date) // summarizes the categories of types that currently belong here diff --git a/internal/netxlite/getaddrinfo_linux.go b/internal/netxlite/getaddrinfo_linux.go index f7e3fed320..f625c83f1d 100644 --- a/internal/netxlite/getaddrinfo_linux.go +++ b/internal/netxlite/getaddrinfo_linux.go @@ -109,7 +109,7 @@ func (state *getaddrinfoState) toError(code int64, err error, goos string) error // was a bug, fixed in glibc 2.27, were EAI_NONAME was returned // when EAI_NODATA would actually have been more proper: // -// https://sourceware.org/bugzilla/show_bug.cgi?id=21922 +// https://sourceware.org/bugzilla/show_bug.cgi?id=21922 // // 3. Android libc: EAI_NODATA is defined in netdb.h and is not // protected by any feature flag. The getaddrinfo function (as @@ -124,12 +124,12 @@ func (state *getaddrinfoState) toError(code int64, err error, goos string) error // So, android_getaddrinfo_proxy was introduced a long time // ago on October 28, 2010 by this commit: // -// https://github.com/aosp-mirror/platform_bionic/commit/a1dbf0b453801620565e5911f354f82706b0200d +// https://github.com/aosp-mirror/platform_bionic/commit/a1dbf0b453801620565e5911f354f82706b0200d // // Then a subsequent commit changed android_getaddrinfo_proxy // to basically default to EAI_NODATA on proxy errors: // -// https://github.com/aosp-mirror/platform_bionic/commit/c63e59039d28c352e3053bb81319e960c392dbd4 +// https://github.com/aosp-mirror/platform_bionic/commit/c63e59039d28c352e3053bb81319e960c392dbd4 // // As of today and 4ebdeebef74, android_getaddrinfo_proxy returns // one of the following possible return codes: diff --git a/internal/engine/probeservices/benchselect.go b/internal/probeservices/benchselect.go similarity index 100% rename from internal/engine/probeservices/benchselect.go rename to internal/probeservices/benchselect.go diff --git a/internal/engine/probeservices/bouncer.go b/internal/probeservices/bouncer.go similarity index 100% rename from internal/engine/probeservices/bouncer.go rename to internal/probeservices/bouncer.go diff --git a/internal/engine/probeservices/bouncer_test.go b/internal/probeservices/bouncer_test.go similarity index 100% rename from internal/engine/probeservices/bouncer_test.go rename to internal/probeservices/bouncer_test.go diff --git a/internal/engine/probeservices/checkin.go b/internal/probeservices/checkin.go similarity index 100% rename from internal/engine/probeservices/checkin.go rename to internal/probeservices/checkin.go diff --git a/internal/engine/probeservices/checkin_test.go b/internal/probeservices/checkin_test.go similarity index 100% rename from internal/engine/probeservices/checkin_test.go rename to internal/probeservices/checkin_test.go diff --git a/internal/engine/probeservices/collector.go b/internal/probeservices/collector.go similarity index 100% rename from internal/engine/probeservices/collector.go rename to internal/probeservices/collector.go diff --git a/internal/engine/probeservices/collector_test.go b/internal/probeservices/collector_test.go similarity index 100% rename from internal/engine/probeservices/collector_test.go rename to internal/probeservices/collector_test.go diff --git a/internal/engine/probeservices/login.go b/internal/probeservices/login.go similarity index 100% rename from internal/engine/probeservices/login.go rename to internal/probeservices/login.go diff --git a/internal/engine/probeservices/login_test.go b/internal/probeservices/login_test.go similarity index 100% rename from internal/engine/probeservices/login_test.go rename to internal/probeservices/login_test.go diff --git a/internal/engine/probeservices/measurementmeta.go b/internal/probeservices/measurementmeta.go similarity index 100% rename from internal/engine/probeservices/measurementmeta.go rename to internal/probeservices/measurementmeta.go diff --git a/internal/engine/probeservices/measurementmeta_test.go b/internal/probeservices/measurementmeta_test.go similarity index 100% rename from internal/engine/probeservices/measurementmeta_test.go rename to internal/probeservices/measurementmeta_test.go diff --git a/internal/engine/probeservices/orchestra_test.go b/internal/probeservices/orchestra_test.go similarity index 100% rename from internal/engine/probeservices/orchestra_test.go rename to internal/probeservices/orchestra_test.go diff --git a/internal/engine/probeservices/probeservices.go b/internal/probeservices/probeservices.go similarity index 100% rename from internal/engine/probeservices/probeservices.go rename to internal/probeservices/probeservices.go diff --git a/internal/engine/probeservices/probeservices_test.go b/internal/probeservices/probeservices_test.go similarity index 99% rename from internal/engine/probeservices/probeservices_test.go rename to internal/probeservices/probeservices_test.go index c2e163c84a..00c24dc741 100644 --- a/internal/engine/probeservices/probeservices_test.go +++ b/internal/probeservices/probeservices_test.go @@ -11,7 +11,7 @@ import ( "github.com/apex/log" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/internal/netxlite" ) diff --git a/internal/engine/probeservices/psiphon.go b/internal/probeservices/psiphon.go similarity index 100% rename from internal/engine/probeservices/psiphon.go rename to internal/probeservices/psiphon.go diff --git a/internal/engine/probeservices/psiphon_test.go b/internal/probeservices/psiphon_test.go similarity index 100% rename from internal/engine/probeservices/psiphon_test.go rename to internal/probeservices/psiphon_test.go diff --git a/internal/engine/probeservices/register.go b/internal/probeservices/register.go similarity index 100% rename from internal/engine/probeservices/register.go rename to internal/probeservices/register.go diff --git a/internal/engine/probeservices/register_test.go b/internal/probeservices/register_test.go similarity index 100% rename from internal/engine/probeservices/register_test.go rename to internal/probeservices/register_test.go diff --git a/internal/engine/probeservices/statefile.go b/internal/probeservices/statefile.go similarity index 100% rename from internal/engine/probeservices/statefile.go rename to internal/probeservices/statefile.go diff --git a/internal/engine/probeservices/statefile_test.go b/internal/probeservices/statefile_test.go similarity index 100% rename from internal/engine/probeservices/statefile_test.go rename to internal/probeservices/statefile_test.go diff --git a/internal/engine/probeservices/tor.go b/internal/probeservices/tor.go similarity index 100% rename from internal/engine/probeservices/tor.go rename to internal/probeservices/tor.go diff --git a/internal/engine/probeservices/tor_test.go b/internal/probeservices/tor_test.go similarity index 100% rename from internal/engine/probeservices/tor_test.go rename to internal/probeservices/tor_test.go diff --git a/internal/engine/sessionresolver/doc.go b/internal/sessionresolver/doc.go similarity index 100% rename from internal/engine/sessionresolver/doc.go rename to internal/sessionresolver/doc.go diff --git a/internal/engine/sessionresolver/errwrapper.go b/internal/sessionresolver/errwrapper.go similarity index 100% rename from internal/engine/sessionresolver/errwrapper.go rename to internal/sessionresolver/errwrapper.go diff --git a/internal/engine/sessionresolver/errwrapper_test.go b/internal/sessionresolver/errwrapper_test.go similarity index 100% rename from internal/engine/sessionresolver/errwrapper_test.go rename to internal/sessionresolver/errwrapper_test.go diff --git a/internal/engine/sessionresolver/integration_test.go b/internal/sessionresolver/integration_test.go similarity index 90% rename from internal/engine/sessionresolver/integration_test.go rename to internal/sessionresolver/integration_test.go index 4872678244..0b4231b680 100644 --- a/internal/engine/sessionresolver/integration_test.go +++ b/internal/sessionresolver/integration_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/sessionresolver" "github.com/ooni/probe-cli/v3/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/sessionresolver" ) func TestSessionResolverGood(t *testing.T) { diff --git a/internal/engine/sessionresolver/jsoncodec.go b/internal/sessionresolver/jsoncodec.go similarity index 100% rename from internal/engine/sessionresolver/jsoncodec.go rename to internal/sessionresolver/jsoncodec.go diff --git a/internal/engine/sessionresolver/jsoncodec_test.go b/internal/sessionresolver/jsoncodec_test.go similarity index 100% rename from internal/engine/sessionresolver/jsoncodec_test.go rename to internal/sessionresolver/jsoncodec_test.go diff --git a/internal/engine/sessionresolver/lookup.go b/internal/sessionresolver/lookup.go similarity index 100% rename from internal/engine/sessionresolver/lookup.go rename to internal/sessionresolver/lookup.go diff --git a/internal/engine/sessionresolver/lookup_test.go b/internal/sessionresolver/lookup_test.go similarity index 100% rename from internal/engine/sessionresolver/lookup_test.go rename to internal/sessionresolver/lookup_test.go diff --git a/internal/engine/sessionresolver/resolver.go b/internal/sessionresolver/resolver.go similarity index 100% rename from internal/engine/sessionresolver/resolver.go rename to internal/sessionresolver/resolver.go diff --git a/internal/engine/sessionresolver/resolver_test.go b/internal/sessionresolver/resolver_test.go similarity index 100% rename from internal/engine/sessionresolver/resolver_test.go rename to internal/sessionresolver/resolver_test.go diff --git a/internal/engine/sessionresolver/resolvermaker.go b/internal/sessionresolver/resolvermaker.go similarity index 98% rename from internal/engine/sessionresolver/resolvermaker.go rename to internal/sessionresolver/resolvermaker.go index 303c107341..2bd7f79fd2 100644 --- a/internal/engine/sessionresolver/resolvermaker.go +++ b/internal/sessionresolver/resolvermaker.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/ooni/probe-cli/v3/internal/engine/netx" + "github.com/ooni/probe-cli/v3/internal/legacy/netx" "github.com/ooni/probe-cli/v3/internal/model" ) diff --git a/internal/engine/sessionresolver/resolvermaker_test.go b/internal/sessionresolver/resolvermaker_test.go similarity index 100% rename from internal/engine/sessionresolver/resolvermaker_test.go rename to internal/sessionresolver/resolvermaker_test.go diff --git a/internal/engine/sessionresolver/state.go b/internal/sessionresolver/state.go similarity index 100% rename from internal/engine/sessionresolver/state.go rename to internal/sessionresolver/state.go diff --git a/internal/engine/sessionresolver/state_test.go b/internal/sessionresolver/state_test.go similarity index 100% rename from internal/engine/sessionresolver/state_test.go rename to internal/sessionresolver/state_test.go diff --git a/internal/tutorial/experiment/torsf/chapter01/README.md b/internal/tutorial/experiment/torsf/chapter01/README.md index eebb606560..dce51cab1c 100644 --- a/internal/tutorial/experiment/torsf/chapter01/README.md +++ b/internal/tutorial/experiment/torsf/chapter01/README.md @@ -62,7 +62,7 @@ The torsf package contains the implementation of the torsf experiment. The mockable package contains widely used mocks. ```Go - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" ``` diff --git a/internal/tutorial/experiment/torsf/chapter01/main.go b/internal/tutorial/experiment/torsf/chapter01/main.go index d96c5f34c0..e5dada1962 100644 --- a/internal/tutorial/experiment/torsf/chapter01/main.go +++ b/internal/tutorial/experiment/torsf/chapter01/main.go @@ -63,7 +63,7 @@ import ( // The mockable package contains widely used mocks. // // ```Go - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" // ``` // diff --git a/internal/tutorial/experiment/torsf/chapter02/main.go b/internal/tutorial/experiment/torsf/chapter02/main.go index efded79994..4e1110bcfb 100644 --- a/internal/tutorial/experiment/torsf/chapter02/main.go +++ b/internal/tutorial/experiment/torsf/chapter02/main.go @@ -7,7 +7,7 @@ import ( "io/ioutil" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "golang.org/x/sys/execabs" ) diff --git a/internal/tutorial/experiment/torsf/chapter03/main.go b/internal/tutorial/experiment/torsf/chapter03/main.go index 1e9c8ec861..85643258c5 100644 --- a/internal/tutorial/experiment/torsf/chapter03/main.go +++ b/internal/tutorial/experiment/torsf/chapter03/main.go @@ -7,7 +7,7 @@ import ( "io/ioutil" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "golang.org/x/sys/execabs" ) diff --git a/internal/tutorial/experiment/torsf/chapter04/main.go b/internal/tutorial/experiment/torsf/chapter04/main.go index 1e9c8ec861..85643258c5 100644 --- a/internal/tutorial/experiment/torsf/chapter04/main.go +++ b/internal/tutorial/experiment/torsf/chapter04/main.go @@ -7,7 +7,7 @@ import ( "io/ioutil" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/mockable" + "github.com/ooni/probe-cli/v3/internal/legacy/mockable" "github.com/ooni/probe-cli/v3/internal/model" "golang.org/x/sys/execabs" ) diff --git a/internal/tutorial/generator/main.go b/internal/tutorial/generator/main.go index b35316f2e2..1ac9b364ad 100644 --- a/internal/tutorial/generator/main.go +++ b/internal/tutorial/generator/main.go @@ -64,7 +64,7 @@ func gen1(destfile io.Writer, filepath string) { // files using the specified order. Note that files names are not // paths, just file names, e.g., // -// gen("./experiment/torsf/chapter01", "main.go") +// gen("./experiment/torsf/chapter01", "main.go") func gen(dirpath string, files ...string) { readme := path.Join(dirpath, "README.md") destfile, err := os.Create(path.Join(readme)) diff --git a/pkg/oonimkall/doc.go b/pkg/oonimkall/doc.go index 3377b22630..bf1302e58c 100644 --- a/pkg/oonimkall/doc.go +++ b/pkg/oonimkall/doc.go @@ -9,11 +9,11 @@ // reimplementation of the mkall API implemented by Measurement Kit // in, e.g., https://github.com/measurement-kit/mkall-ios. // -// Design +// # Design // // See docs/design/dd-001-oonimkall.md in the probe-cli repository. // -// Semantic versioning policy +// # Semantic versioning policy // // This package is public for technical reasons. We cannot use `go // mobile` on a private package. Yet, we are not going to bump this @@ -21,7 +21,7 @@ // consider this package our private API for interfacing with our // mobile applications for Android and iOS. // -// Task API +// # Task API // // The basic tenet of the task API is that you define an experiment // task you wanna run using a JSON, then you start a task for it, and @@ -41,7 +41,7 @@ // See also https://github.com/ooni/probe-cli/v3/internal/engine/blob/master/DESIGN.md, // which explains why we implemented the oonimkall API. // -// Session API +// # Session API // // The Session API is a Go API that can be exported to mobile apps // using the gomobile tool. The latest design document for this API is diff --git a/pkg/oonimkall/session.go b/pkg/oonimkall/session.go index dd601ce416..39bb4d80f2 100644 --- a/pkg/oonimkall/session.go +++ b/pkg/oonimkall/session.go @@ -10,10 +10,10 @@ import ( "sync/atomic" "github.com/ooni/probe-cli/v3/internal/engine" - "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/kvstore" "github.com/ooni/probe-cli/v3/internal/legacy/assetsdir" "github.com/ooni/probe-cli/v3/internal/model" + "github.com/ooni/probe-cli/v3/internal/probeservices" "github.com/ooni/probe-cli/v3/internal/runtimex" ) diff --git a/pkg/oonimkall/session_integration_test.go b/pkg/oonimkall/session_integration_test.go index 2d302d19e9..a86eac412f 100644 --- a/pkg/oonimkall/session_integration_test.go +++ b/pkg/oonimkall/session_integration_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/ooni/probe-cli/v3/internal/engine/geolocate" + "github.com/ooni/probe-cli/v3/internal/geolocate" "github.com/ooni/probe-cli/v3/internal/model" "github.com/ooni/probe-cli/v3/pkg/oonimkall" ) diff --git a/script/gorenamepkg.bash b/script/gorenamepkg.bash index 676929f3c8..3dc476ed84 100755 --- a/script/gorenamepkg.bash +++ b/script/gorenamepkg.bash @@ -30,7 +30,7 @@ pkg_after=$pkg_prefix/$name_after for file in $(find . -type f -name \*.go); do echo "editing the import path of $file" - cat $file | sed -e "s|\"$pkg_before\"|\"$pkg_after\"|g" > $file.tmp + cat $file | sed -e "s|\"$pkg_before|\"$pkg_after|g" > $file.tmp cat $file.tmp > $file rm $file.tmp done