From 863595a3da3e803abd7d9970d07c4055ac7b99c7 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 3 Feb 2021 12:23:15 +0100 Subject: [PATCH] refactor: move more commands to internal/cmd (#207) * refactor: move more commands to internal/cmd Part of https://github.com/ooni/probe/issues/1335. We would like all commands to be at the same level of engine rather than inside engine (now that we can do it). * fix: update .gitignore * refactor: also move jafar outside engine * We should be good now? --- .gitignore | 6 ++++++ cmd/ooniprobe/internal/autorun/autorun_darwin.go | 2 +- internal/cmd/README.md | 4 ++++ internal/{engine => }/cmd/apitool/README.md | 0 internal/{engine => }/cmd/apitool/main.go | 4 ++-- internal/{engine => }/cmd/apitool/main_test.go | 0 internal/cmd/jafar/.gitignore | 1 + internal/{engine => }/cmd/jafar/README.md | 0 .../{engine => }/cmd/jafar/badproxy/badproxy.go | 0 .../cmd/jafar/badproxy/badproxy_test.go | 0 .../{engine => }/cmd/jafar/flagx/stringarray.go | 0 .../cmd/jafar/flagx/stringarray_test.go | 2 +- .../cmd/jafar/httpproxy/httpproxy.go | 0 .../cmd/jafar/httpproxy/httpproxy_test.go | 2 +- .../{engine => }/cmd/jafar/iptables/iptables.go | 0 .../jafar/iptables/iptables_integration_test.go | 6 +++--- .../cmd/jafar/iptables/iptables_linux.go | 2 +- .../cmd/jafar/iptables/iptables_unsupported.go | 0 internal/{engine => }/cmd/jafar/main.go | 16 ++++++++-------- internal/{engine => }/cmd/jafar/main_test.go | 4 ++-- .../{engine => }/cmd/jafar/resolver/resolver.go | 0 .../cmd/jafar/resolver/resolver_test.go | 2 +- .../{engine => }/cmd/jafar/tlsproxy/tlsproxy.go | 0 .../cmd/jafar/tlsproxy/tlsproxy_test.go | 2 +- .../cmd/jafar/uncensored/uncensored.go | 0 .../cmd/jafar/uncensored/uncensored_test.go | 0 internal/{engine => }/cmd/oohelper/README.md | 0 .../{engine => }/cmd/oohelper/internal/client.go | 2 +- .../cmd/oohelper/internal/client_test.go | 2 +- .../cmd/oohelper/internal/fake_test.go | 0 internal/{engine => }/cmd/oohelper/oohelper.go | 2 +- .../{engine => }/cmd/oohelper/oohelper_test.go | 0 internal/{engine => }/cmd/oohelperd/README.md | 0 .../{engine => }/cmd/oohelperd/internal/dns.go | 0 .../cmd/oohelperd/internal/fake_test.go | 0 .../{engine => }/cmd/oohelperd/internal/http.go | 0 .../cmd/oohelperd/internal/http_test.go | 2 +- .../cmd/oohelperd/internal/internal.go | 0 .../cmd/oohelperd/internal/internal_test.go | 2 +- .../cmd/oohelperd/internal/measure.go | 0 .../cmd/oohelperd/internal/tcpconnect.go | 0 internal/{engine => }/cmd/oohelperd/oohelperd.go | 2 +- .../{engine => }/cmd/oohelperd/oohelperd_test.go | 0 internal/engine/.gitignore | 2 -- internal/engine/cmd/README.md | 3 --- internal/engine/experiment/hhfm/hhfm.go | 2 +- internal/engine/experiment/tor/tor.go | 2 +- internal/engine/experiment/urlgetter/runner.go | 2 +- .../engine/experiment/urlgetter/runner_test.go | 2 +- .../engine/experiment/webconnectivity/control.go | 2 +- .../webconnectivity/webconnectivity.go | 2 +- internal/engine/geolocate/avast.go | 2 +- internal/engine/geolocate/avast_test.go | 2 +- internal/engine/geolocate/ipconfig.go | 4 ++-- internal/engine/geolocate/ipconfig_test.go | 2 +- internal/engine/geolocate/ipinfo.go | 4 ++-- internal/engine/geolocate/ipinfo_test.go | 2 +- internal/engine/geolocate/stun_test.go | 2 +- internal/engine/geolocate/ubuntu.go | 2 +- internal/engine/geolocate/ubuntu_test.go | 2 +- .../engine/{internal => }/httpheader/accept.go | 0 .../{internal => }/httpheader/acceptlanguage.go | 0 .../{internal => }/httpheader/useragent.go | 0 .../engine/{internal => }/httpx/fake_test.go | 0 internal/engine/{internal => }/httpx/fetch.go | 0 .../engine/{internal => }/httpx/fetch_test.go | 2 +- internal/engine/{internal => }/httpx/jsonapi.go | 0 .../engine/{internal => }/httpx/jsonapi_test.go | 2 +- internal/engine/inputloader_integration_test.go | 2 +- internal/engine/internal/mockable/mockable.go | 2 +- .../engine/{internal => }/kvstore/kvstore.go | 0 .../{internal => }/kvstore/kvstore_test.go | 0 internal/engine/netx/resolver/dnsoverhttps.go | 2 +- .../engine/netx/resolver/dnsoverhttps_test.go | 2 +- internal/engine/probeservices/checkreportid.go | 2 +- .../engine/probeservices/checkreportid_test.go | 4 ++-- internal/engine/probeservices/measurementmeta.go | 2 +- .../engine/probeservices/measurementmeta_test.go | 4 ++-- internal/engine/probeservices/probeservices.go | 2 +- internal/engine/probeservices/statefile_test.go | 2 +- internal/engine/resources/resources.go | 2 +- internal/engine/session.go | 2 +- internal/engine/{cmd/jafar => }/shellx/shellx.go | 0 .../engine/{cmd/jafar => }/shellx/shellx_test.go | 0 pkg/.gitignore | 1 + 85 files changed, 72 insertions(+), 65 deletions(-) create mode 100644 internal/cmd/README.md rename internal/{engine => }/cmd/apitool/README.md (100%) rename internal/{engine => }/cmd/apitool/main.go (95%) rename internal/{engine => }/cmd/apitool/main_test.go (100%) create mode 100644 internal/cmd/jafar/.gitignore rename internal/{engine => }/cmd/jafar/README.md (100%) rename internal/{engine => }/cmd/jafar/badproxy/badproxy.go (100%) rename internal/{engine => }/cmd/jafar/badproxy/badproxy_test.go (100%) rename internal/{engine => }/cmd/jafar/flagx/stringarray.go (100%) rename internal/{engine => }/cmd/jafar/flagx/stringarray_test.go (96%) rename internal/{engine => }/cmd/jafar/httpproxy/httpproxy.go (100%) rename internal/{engine => }/cmd/jafar/httpproxy/httpproxy_test.go (97%) rename internal/{engine => }/cmd/jafar/iptables/iptables.go (100%) rename internal/{engine => }/cmd/jafar/iptables/iptables_integration_test.go (97%) rename internal/{engine => }/cmd/jafar/iptables/iptables_linux.go (98%) rename internal/{engine => }/cmd/jafar/iptables/iptables_unsupported.go (100%) rename internal/{engine => }/cmd/jafar/main.go (93%) rename internal/{engine => }/cmd/jafar/main_test.go (92%) rename internal/{engine => }/cmd/jafar/resolver/resolver.go (100%) rename internal/{engine => }/cmd/jafar/resolver/resolver_test.go (98%) rename internal/{engine => }/cmd/jafar/tlsproxy/tlsproxy.go (100%) rename internal/{engine => }/cmd/jafar/tlsproxy/tlsproxy_test.go (98%) rename internal/{engine => }/cmd/jafar/uncensored/uncensored.go (100%) rename internal/{engine => }/cmd/jafar/uncensored/uncensored_test.go (100%) rename internal/{engine => }/cmd/oohelper/README.md (100%) rename internal/{engine => }/cmd/oohelper/internal/client.go (98%) rename internal/{engine => }/cmd/oohelper/internal/client_test.go (99%) rename internal/{engine => }/cmd/oohelper/internal/fake_test.go (100%) rename internal/{engine => }/cmd/oohelper/oohelper.go (95%) rename internal/{engine => }/cmd/oohelper/oohelper_test.go (100%) rename internal/{engine => }/cmd/oohelperd/README.md (100%) rename internal/{engine => }/cmd/oohelperd/internal/dns.go (100%) rename internal/{engine => }/cmd/oohelperd/internal/fake_test.go (100%) rename internal/{engine => }/cmd/oohelperd/internal/http.go (100%) rename internal/{engine => }/cmd/oohelperd/internal/http_test.go (95%) rename internal/{engine => }/cmd/oohelperd/internal/internal.go (100%) rename internal/{engine => }/cmd/oohelperd/internal/internal_test.go (98%) rename internal/{engine => }/cmd/oohelperd/internal/measure.go (100%) rename internal/{engine => }/cmd/oohelperd/internal/tcpconnect.go (100%) rename internal/{engine => }/cmd/oohelperd/oohelperd.go (95%) rename internal/{engine => }/cmd/oohelperd/oohelperd_test.go (100%) delete mode 100644 internal/engine/cmd/README.md rename internal/engine/{internal => }/httpheader/accept.go (100%) rename internal/engine/{internal => }/httpheader/acceptlanguage.go (100%) rename internal/engine/{internal => }/httpheader/useragent.go (100%) rename internal/engine/{internal => }/httpx/fake_test.go (100%) rename internal/engine/{internal => }/httpx/fetch.go (100%) rename internal/engine/{internal => }/httpx/fetch_test.go (98%) rename internal/engine/{internal => }/httpx/jsonapi.go (100%) rename internal/engine/{internal => }/httpx/jsonapi_test.go (99%) rename internal/engine/{internal => }/kvstore/kvstore.go (100%) rename internal/engine/{internal => }/kvstore/kvstore_test.go (100%) rename internal/engine/{cmd/jafar => }/shellx/shellx.go (100%) rename internal/engine/{cmd/jafar => }/shellx/shellx_test.go (100%) create mode 100644 pkg/.gitignore diff --git a/.gitignore b/.gitignore index 8e8da87b90..f57e825626 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,15 @@ /*.jsonl /*.tar.gz /*.zip +/apitool +/apitool.exe /coverage.cov /miniooni /miniooni.exe +/oohelper +/oohelper.exe +/oohelperd +/oohelperd.exe /ooniprobe /ooniprobe.exe /ooniprobe_checksums.txt diff --git a/cmd/ooniprobe/internal/autorun/autorun_darwin.go b/cmd/ooniprobe/internal/autorun/autorun_darwin.go index 805a32a03e..4c0c424ce6 100644 --- a/cmd/ooniprobe/internal/autorun/autorun_darwin.go +++ b/cmd/ooniprobe/internal/autorun/autorun_darwin.go @@ -13,7 +13,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/utils" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" "golang.org/x/sys/unix" ) diff --git a/internal/cmd/README.md b/internal/cmd/README.md new file mode 100644 index 0000000000..827f2ad638 --- /dev/null +++ b/internal/cmd/README.md @@ -0,0 +1,4 @@ +# Directory github.com/ooni/probe-cli/internal/cmd + +This directory contains the source code for the CLI tools we build +but we don't want to expose to the outside world. diff --git a/internal/engine/cmd/apitool/README.md b/internal/cmd/apitool/README.md similarity index 100% rename from internal/engine/cmd/apitool/README.md rename to internal/cmd/apitool/README.md diff --git a/internal/engine/cmd/apitool/main.go b/internal/cmd/apitool/main.go similarity index 95% rename from internal/engine/cmd/apitool/main.go rename to internal/cmd/apitool/main.go index 8db01afee9..d2762dde2a 100644 --- a/internal/engine/cmd/apitool/main.go +++ b/internal/cmd/apitool/main.go @@ -17,8 +17,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" "github.com/ooni/probe-cli/v3/internal/engine/version" diff --git a/internal/engine/cmd/apitool/main_test.go b/internal/cmd/apitool/main_test.go similarity index 100% rename from internal/engine/cmd/apitool/main_test.go rename to internal/cmd/apitool/main_test.go diff --git a/internal/cmd/jafar/.gitignore b/internal/cmd/jafar/.gitignore new file mode 100644 index 0000000000..8e4647b852 --- /dev/null +++ b/internal/cmd/jafar/.gitignore @@ -0,0 +1 @@ +/badproxy.pem diff --git a/internal/engine/cmd/jafar/README.md b/internal/cmd/jafar/README.md similarity index 100% rename from internal/engine/cmd/jafar/README.md rename to internal/cmd/jafar/README.md diff --git a/internal/engine/cmd/jafar/badproxy/badproxy.go b/internal/cmd/jafar/badproxy/badproxy.go similarity index 100% rename from internal/engine/cmd/jafar/badproxy/badproxy.go rename to internal/cmd/jafar/badproxy/badproxy.go diff --git a/internal/engine/cmd/jafar/badproxy/badproxy_test.go b/internal/cmd/jafar/badproxy/badproxy_test.go similarity index 100% rename from internal/engine/cmd/jafar/badproxy/badproxy_test.go rename to internal/cmd/jafar/badproxy/badproxy_test.go diff --git a/internal/engine/cmd/jafar/flagx/stringarray.go b/internal/cmd/jafar/flagx/stringarray.go similarity index 100% rename from internal/engine/cmd/jafar/flagx/stringarray.go rename to internal/cmd/jafar/flagx/stringarray.go diff --git a/internal/engine/cmd/jafar/flagx/stringarray_test.go b/internal/cmd/jafar/flagx/stringarray_test.go similarity index 96% rename from internal/engine/cmd/jafar/flagx/stringarray_test.go rename to internal/cmd/jafar/flagx/stringarray_test.go index f605ca64c9..256d1ed90d 100644 --- a/internal/engine/cmd/jafar/flagx/stringarray_test.go +++ b/internal/cmd/jafar/flagx/stringarray_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/flagx" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/flagx" ) func TestStringArray(t *testing.T) { diff --git a/internal/engine/cmd/jafar/httpproxy/httpproxy.go b/internal/cmd/jafar/httpproxy/httpproxy.go similarity index 100% rename from internal/engine/cmd/jafar/httpproxy/httpproxy.go rename to internal/cmd/jafar/httpproxy/httpproxy.go diff --git a/internal/engine/cmd/jafar/httpproxy/httpproxy_test.go b/internal/cmd/jafar/httpproxy/httpproxy_test.go similarity index 97% rename from internal/engine/cmd/jafar/httpproxy/httpproxy_test.go rename to internal/cmd/jafar/httpproxy/httpproxy_test.go index db1849ba76..8318ade343 100644 --- a/internal/engine/cmd/jafar/httpproxy/httpproxy_test.go +++ b/internal/cmd/jafar/httpproxy/httpproxy_test.go @@ -8,7 +8,7 @@ import ( "net/http" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" ) func TestPass(t *testing.T) { diff --git a/internal/engine/cmd/jafar/iptables/iptables.go b/internal/cmd/jafar/iptables/iptables.go similarity index 100% rename from internal/engine/cmd/jafar/iptables/iptables.go rename to internal/cmd/jafar/iptables/iptables.go diff --git a/internal/engine/cmd/jafar/iptables/iptables_integration_test.go b/internal/cmd/jafar/iptables/iptables_integration_test.go similarity index 97% rename from internal/engine/cmd/jafar/iptables/iptables_integration_test.go rename to internal/cmd/jafar/iptables/iptables_integration_test.go index afdef2aa38..13c73acfb1 100644 --- a/internal/engine/cmd/jafar/iptables/iptables_integration_test.go +++ b/internal/cmd/jafar/iptables/iptables_integration_test.go @@ -14,9 +14,9 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/resolver" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/resolver" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" ) func init() { diff --git a/internal/engine/cmd/jafar/iptables/iptables_linux.go b/internal/cmd/jafar/iptables/iptables_linux.go similarity index 98% rename from internal/engine/cmd/jafar/iptables/iptables_linux.go rename to internal/cmd/jafar/iptables/iptables_linux.go index 7f53f3bfe9..058c9b6ef7 100644 --- a/internal/engine/cmd/jafar/iptables/iptables_linux.go +++ b/internal/cmd/jafar/iptables/iptables_linux.go @@ -3,8 +3,8 @@ package iptables import ( - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" ) type linuxShell struct{} diff --git a/internal/engine/cmd/jafar/iptables/iptables_unsupported.go b/internal/cmd/jafar/iptables/iptables_unsupported.go similarity index 100% rename from internal/engine/cmd/jafar/iptables/iptables_unsupported.go rename to internal/cmd/jafar/iptables/iptables_unsupported.go diff --git a/internal/engine/cmd/jafar/main.go b/internal/cmd/jafar/main.go similarity index 93% rename from internal/engine/cmd/jafar/main.go rename to internal/cmd/jafar/main.go index a1404bcf4b..514df4fe23 100644 --- a/internal/engine/cmd/jafar/main.go +++ b/internal/cmd/jafar/main.go @@ -18,15 +18,15 @@ import ( "github.com/apex/log" "github.com/apex/log/handlers/cli" "github.com/miekg/dns" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/badproxy" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/flagx" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/httpproxy" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/iptables" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/resolver" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/tlsproxy" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/badproxy" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/flagx" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/httpproxy" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/iptables" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/resolver" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/tlsproxy" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" ) var ( diff --git a/internal/engine/cmd/jafar/main_test.go b/internal/cmd/jafar/main_test.go similarity index 92% rename from internal/engine/cmd/jafar/main_test.go rename to internal/cmd/jafar/main_test.go index 49c6f297a1..5c356f1fd6 100644 --- a/internal/engine/cmd/jafar/main_test.go +++ b/internal/cmd/jafar/main_test.go @@ -6,8 +6,8 @@ import ( "runtime" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/iptables" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/shellx" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/iptables" + "github.com/ooni/probe-cli/v3/internal/engine/shellx" ) func ensureWeStartOverWithIPTables() { diff --git a/internal/engine/cmd/jafar/resolver/resolver.go b/internal/cmd/jafar/resolver/resolver.go similarity index 100% rename from internal/engine/cmd/jafar/resolver/resolver.go rename to internal/cmd/jafar/resolver/resolver.go diff --git a/internal/engine/cmd/jafar/resolver/resolver_test.go b/internal/cmd/jafar/resolver/resolver_test.go similarity index 98% rename from internal/engine/cmd/jafar/resolver/resolver_test.go rename to internal/cmd/jafar/resolver/resolver_test.go index 254aaa3b51..1d363ecf6d 100644 --- a/internal/engine/cmd/jafar/resolver/resolver_test.go +++ b/internal/cmd/jafar/resolver/resolver_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/miekg/dns" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" ) func TestPass(t *testing.T) { diff --git a/internal/engine/cmd/jafar/tlsproxy/tlsproxy.go b/internal/cmd/jafar/tlsproxy/tlsproxy.go similarity index 100% rename from internal/engine/cmd/jafar/tlsproxy/tlsproxy.go rename to internal/cmd/jafar/tlsproxy/tlsproxy.go diff --git a/internal/engine/cmd/jafar/tlsproxy/tlsproxy_test.go b/internal/cmd/jafar/tlsproxy/tlsproxy_test.go similarity index 98% rename from internal/engine/cmd/jafar/tlsproxy/tlsproxy_test.go rename to internal/cmd/jafar/tlsproxy/tlsproxy_test.go index f7b1e38fb2..5282ed99b5 100644 --- a/internal/engine/cmd/jafar/tlsproxy/tlsproxy_test.go +++ b/internal/cmd/jafar/tlsproxy/tlsproxy_test.go @@ -7,7 +7,7 @@ import ( "sync" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/jafar/uncensored" + "github.com/ooni/probe-cli/v3/internal/cmd/jafar/uncensored" ) func TestPass(t *testing.T) { diff --git a/internal/engine/cmd/jafar/uncensored/uncensored.go b/internal/cmd/jafar/uncensored/uncensored.go similarity index 100% rename from internal/engine/cmd/jafar/uncensored/uncensored.go rename to internal/cmd/jafar/uncensored/uncensored.go diff --git a/internal/engine/cmd/jafar/uncensored/uncensored_test.go b/internal/cmd/jafar/uncensored/uncensored_test.go similarity index 100% rename from internal/engine/cmd/jafar/uncensored/uncensored_test.go rename to internal/cmd/jafar/uncensored/uncensored_test.go diff --git a/internal/engine/cmd/oohelper/README.md b/internal/cmd/oohelper/README.md similarity index 100% rename from internal/engine/cmd/oohelper/README.md rename to internal/cmd/oohelper/README.md diff --git a/internal/engine/cmd/oohelper/internal/client.go b/internal/cmd/oohelper/internal/client.go similarity index 98% rename from internal/engine/cmd/oohelper/internal/client.go rename to internal/cmd/oohelper/internal/client.go index 10160f83c7..7da96d9fa7 100644 --- a/internal/engine/cmd/oohelper/internal/client.go +++ b/internal/cmd/oohelper/internal/client.go @@ -13,7 +13,7 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/experiment/webconnectivity" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/version" diff --git a/internal/engine/cmd/oohelper/internal/client_test.go b/internal/cmd/oohelper/internal/client_test.go similarity index 99% rename from internal/engine/cmd/oohelper/internal/client_test.go rename to internal/cmd/oohelper/internal/client_test.go index bace44ae91..f6634083f7 100644 --- a/internal/engine/cmd/oohelper/internal/client_test.go +++ b/internal/cmd/oohelper/internal/client_test.go @@ -8,7 +8,7 @@ import ( "reflect" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelper/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelper/internal" ) func TestMakeTCPEndpoints(t *testing.T) { diff --git a/internal/engine/cmd/oohelper/internal/fake_test.go b/internal/cmd/oohelper/internal/fake_test.go similarity index 100% rename from internal/engine/cmd/oohelper/internal/fake_test.go rename to internal/cmd/oohelper/internal/fake_test.go diff --git a/internal/engine/cmd/oohelper/oohelper.go b/internal/cmd/oohelper/oohelper.go similarity index 95% rename from internal/engine/cmd/oohelper/oohelper.go rename to internal/cmd/oohelper/oohelper.go index 38376c680c..c63620c7fa 100644 --- a/internal/engine/cmd/oohelper/oohelper.go +++ b/internal/cmd/oohelper/oohelper.go @@ -10,7 +10,7 @@ import ( "net/http" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelper/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelper/internal" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" ) diff --git a/internal/engine/cmd/oohelper/oohelper_test.go b/internal/cmd/oohelper/oohelper_test.go similarity index 100% rename from internal/engine/cmd/oohelper/oohelper_test.go rename to internal/cmd/oohelper/oohelper_test.go diff --git a/internal/engine/cmd/oohelperd/README.md b/internal/cmd/oohelperd/README.md similarity index 100% rename from internal/engine/cmd/oohelperd/README.md rename to internal/cmd/oohelperd/README.md diff --git a/internal/engine/cmd/oohelperd/internal/dns.go b/internal/cmd/oohelperd/internal/dns.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/dns.go rename to internal/cmd/oohelperd/internal/dns.go diff --git a/internal/engine/cmd/oohelperd/internal/fake_test.go b/internal/cmd/oohelperd/internal/fake_test.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/fake_test.go rename to internal/cmd/oohelperd/internal/fake_test.go diff --git a/internal/engine/cmd/oohelperd/internal/http.go b/internal/cmd/oohelperd/internal/http.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/http.go rename to internal/cmd/oohelperd/internal/http.go diff --git a/internal/engine/cmd/oohelperd/internal/http_test.go b/internal/cmd/oohelperd/internal/http_test.go similarity index 95% rename from internal/engine/cmd/oohelperd/internal/http_test.go rename to internal/cmd/oohelperd/internal/http_test.go index 8022079f41..cca2d4713c 100644 --- a/internal/engine/cmd/oohelperd/internal/http_test.go +++ b/internal/cmd/oohelperd/internal/http_test.go @@ -8,7 +8,7 @@ import ( "sync" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelperd/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelperd/internal" ) func TestHTTPDoWithInvalidURL(t *testing.T) { diff --git a/internal/engine/cmd/oohelperd/internal/internal.go b/internal/cmd/oohelperd/internal/internal.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/internal.go rename to internal/cmd/oohelperd/internal/internal.go diff --git a/internal/engine/cmd/oohelperd/internal/internal_test.go b/internal/cmd/oohelperd/internal/internal_test.go similarity index 98% rename from internal/engine/cmd/oohelperd/internal/internal_test.go rename to internal/cmd/oohelperd/internal/internal_test.go index b7bdecbd1f..1064f2461e 100644 --- a/internal/engine/cmd/oohelperd/internal/internal_test.go +++ b/internal/cmd/oohelperd/internal/internal_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelperd/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelperd/internal" "github.com/ooni/probe-cli/v3/internal/engine/netx/resolver" ) diff --git a/internal/engine/cmd/oohelperd/internal/measure.go b/internal/cmd/oohelperd/internal/measure.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/measure.go rename to internal/cmd/oohelperd/internal/measure.go diff --git a/internal/engine/cmd/oohelperd/internal/tcpconnect.go b/internal/cmd/oohelperd/internal/tcpconnect.go similarity index 100% rename from internal/engine/cmd/oohelperd/internal/tcpconnect.go rename to internal/cmd/oohelperd/internal/tcpconnect.go diff --git a/internal/engine/cmd/oohelperd/oohelperd.go b/internal/cmd/oohelperd/oohelperd.go similarity index 95% rename from internal/engine/cmd/oohelperd/oohelperd.go rename to internal/cmd/oohelperd/oohelperd.go index 48bc3c7728..6b95ce04aa 100644 --- a/internal/engine/cmd/oohelperd/oohelperd.go +++ b/internal/cmd/oohelperd/oohelperd.go @@ -9,7 +9,7 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/cmd/oohelperd/internal" + "github.com/ooni/probe-cli/v3/internal/cmd/oohelperd/internal" "github.com/ooni/probe-cli/v3/internal/engine/netx" ) diff --git a/internal/engine/cmd/oohelperd/oohelperd_test.go b/internal/cmd/oohelperd/oohelperd_test.go similarity index 100% rename from internal/engine/cmd/oohelperd/oohelperd_test.go rename to internal/cmd/oohelperd/oohelperd_test.go diff --git a/internal/engine/.gitignore b/internal/engine/.gitignore index 3757255e6c..4969276605 100644 --- a/internal/engine/.gitignore +++ b/internal/engine/.gitignore @@ -2,9 +2,7 @@ /.vscode /apitool /asn.mmdb -/badproxy.pem /ca-bundle.pem -/cmd/jafar/badproxy.pem /country.mmdb /example.org /jafar diff --git a/internal/engine/cmd/README.md b/internal/engine/cmd/README.md deleted file mode 100644 index 1e27b7378b..0000000000 --- a/internal/engine/cmd/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Directory github.com/ooni/probe-engine/cmd - -This directory contains the source code for the CLI tools we build. diff --git a/internal/engine/experiment/hhfm/hhfm.go b/internal/engine/experiment/hhfm/hhfm.go index 464362ee3c..dce7924f1a 100644 --- a/internal/engine/experiment/hhfm/hhfm.go +++ b/internal/engine/experiment/hhfm/hhfm.go @@ -16,7 +16,7 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/internal/randx" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx" diff --git a/internal/engine/experiment/tor/tor.go b/internal/engine/experiment/tor/tor.go index eab83d96b6..53396b0dcd 100644 --- a/internal/engine/experiment/tor/tor.go +++ b/internal/engine/experiment/tor/tor.go @@ -13,7 +13,7 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/legacy/netxlogger" "github.com/ooni/probe-cli/v3/internal/engine/legacy/oonidatamodel" diff --git a/internal/engine/experiment/urlgetter/runner.go b/internal/engine/experiment/urlgetter/runner.go index 15b09c1db4..ed94b098dc 100644 --- a/internal/engine/experiment/urlgetter/runner.go +++ b/internal/engine/experiment/urlgetter/runner.go @@ -10,7 +10,7 @@ import ( "net/http/cookiejar" "net/url" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/netx" "github.com/ooni/probe-cli/v3/internal/engine/netx/errorx" diff --git a/internal/engine/experiment/urlgetter/runner_test.go b/internal/engine/experiment/urlgetter/runner_test.go index a9852d05f1..fa02c4ebd0 100644 --- a/internal/engine/experiment/urlgetter/runner_test.go +++ b/internal/engine/experiment/urlgetter/runner_test.go @@ -11,7 +11,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/atomicx" "github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestRunnerWithInvalidURLScheme(t *testing.T) { diff --git a/internal/engine/experiment/webconnectivity/control.go b/internal/engine/experiment/webconnectivity/control.go index fecf6e9dcc..8d4b3ab00c 100644 --- a/internal/engine/experiment/webconnectivity/control.go +++ b/internal/engine/experiment/webconnectivity/control.go @@ -4,7 +4,7 @@ import ( "context" "github.com/ooni/probe-cli/v3/internal/engine/geolocate" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx/errorx" ) diff --git a/internal/engine/experiment/webconnectivity/webconnectivity.go b/internal/engine/experiment/webconnectivity/webconnectivity.go index 50419acd04..9788e49e3e 100644 --- a/internal/engine/experiment/webconnectivity/webconnectivity.go +++ b/internal/engine/experiment/webconnectivity/webconnectivity.go @@ -12,7 +12,7 @@ import ( "time" "github.com/ooni/probe-cli/v3/internal/engine/experiment/webconnectivity/internal" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/internal/engine/netx/archival" ) diff --git a/internal/engine/geolocate/avast.go b/internal/engine/geolocate/avast.go index 26c24455d6..fb6f7fd130 100644 --- a/internal/engine/geolocate/avast.go +++ b/internal/engine/geolocate/avast.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) type avastResponse struct { diff --git a/internal/engine/geolocate/avast_test.go b/internal/engine/geolocate/avast_test.go index c16f138542..69c7f683a8 100644 --- a/internal/engine/geolocate/avast_test.go +++ b/internal/engine/geolocate/avast_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestIPLookupWorksUsingAvast(t *testing.T) { diff --git a/internal/engine/geolocate/ipconfig.go b/internal/engine/geolocate/ipconfig.go index 37f8cb3e58..b6baa8c766 100644 --- a/internal/engine/geolocate/ipconfig.go +++ b/internal/engine/geolocate/ipconfig.go @@ -5,8 +5,8 @@ import ( "net/http" "strings" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) func ipConfigIPLookup( diff --git a/internal/engine/geolocate/ipconfig_test.go b/internal/engine/geolocate/ipconfig_test.go index 0fbde20775..ed9b262874 100644 --- a/internal/engine/geolocate/ipconfig_test.go +++ b/internal/engine/geolocate/ipconfig_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestIPLookupWorksUsingIPConfig(t *testing.T) { diff --git a/internal/engine/geolocate/ipinfo.go b/internal/engine/geolocate/ipinfo.go index 773322eb67..5f43427865 100644 --- a/internal/engine/geolocate/ipinfo.go +++ b/internal/engine/geolocate/ipinfo.go @@ -4,8 +4,8 @@ import ( "context" "net/http" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) type ipInfoResponse struct { diff --git a/internal/engine/geolocate/ipinfo_test.go b/internal/engine/geolocate/ipinfo_test.go index 1b257c4234..64f798d7d8 100644 --- a/internal/engine/geolocate/ipinfo_test.go +++ b/internal/engine/geolocate/ipinfo_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestIPLookupWorksUsingIPInfo(t *testing.T) { diff --git a/internal/engine/geolocate/stun_test.go b/internal/engine/geolocate/stun_test.go index ba0c62c364..70d188a96a 100644 --- a/internal/engine/geolocate/stun_test.go +++ b/internal/engine/geolocate/stun_test.go @@ -9,7 +9,7 @@ import ( "time" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/pion/stun" ) diff --git a/internal/engine/geolocate/ubuntu.go b/internal/engine/geolocate/ubuntu.go index 63260a2c82..6fecded864 100644 --- a/internal/engine/geolocate/ubuntu.go +++ b/internal/engine/geolocate/ubuntu.go @@ -5,7 +5,7 @@ import ( "encoding/xml" "net/http" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) type ubuntuResponse struct { diff --git a/internal/engine/geolocate/ubuntu_test.go b/internal/engine/geolocate/ubuntu_test.go index 4575fd34a2..c972a50503 100644 --- a/internal/engine/geolocate/ubuntu_test.go +++ b/internal/engine/geolocate/ubuntu_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) func TestUbuntuParseError(t *testing.T) { diff --git a/internal/engine/internal/httpheader/accept.go b/internal/engine/httpheader/accept.go similarity index 100% rename from internal/engine/internal/httpheader/accept.go rename to internal/engine/httpheader/accept.go diff --git a/internal/engine/internal/httpheader/acceptlanguage.go b/internal/engine/httpheader/acceptlanguage.go similarity index 100% rename from internal/engine/internal/httpheader/acceptlanguage.go rename to internal/engine/httpheader/acceptlanguage.go diff --git a/internal/engine/internal/httpheader/useragent.go b/internal/engine/httpheader/useragent.go similarity index 100% rename from internal/engine/internal/httpheader/useragent.go rename to internal/engine/httpheader/useragent.go diff --git a/internal/engine/internal/httpx/fake_test.go b/internal/engine/httpx/fake_test.go similarity index 100% rename from internal/engine/internal/httpx/fake_test.go rename to internal/engine/httpx/fake_test.go diff --git a/internal/engine/internal/httpx/fetch.go b/internal/engine/httpx/fetch.go similarity index 100% rename from internal/engine/internal/httpx/fetch.go rename to internal/engine/httpx/fetch.go diff --git a/internal/engine/internal/httpx/fetch_test.go b/internal/engine/httpx/fetch_test.go similarity index 98% rename from internal/engine/internal/httpx/fetch_test.go rename to internal/engine/httpx/fetch_test.go index c7086aa0ff..df558747e3 100644 --- a/internal/engine/internal/httpx/fetch_test.go +++ b/internal/engine/httpx/fetch_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/apex/log" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) func TestFetchResourceIntegration(t *testing.T) { diff --git a/internal/engine/internal/httpx/jsonapi.go b/internal/engine/httpx/jsonapi.go similarity index 100% rename from internal/engine/internal/httpx/jsonapi.go rename to internal/engine/httpx/jsonapi.go diff --git a/internal/engine/internal/httpx/jsonapi_test.go b/internal/engine/httpx/jsonapi_test.go similarity index 99% rename from internal/engine/internal/httpx/jsonapi_test.go rename to internal/engine/httpx/jsonapi_test.go index d7a8fecf3a..2e41a98ad8 100644 --- a/internal/engine/internal/httpx/jsonapi_test.go +++ b/internal/engine/httpx/jsonapi_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/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" "github.com/ooni/probe-cli/v3/internal/engine/netx/dialer" ) diff --git a/internal/engine/inputloader_integration_test.go b/internal/engine/inputloader_integration_test.go index 28af8b4d9d..c289256a4a 100644 --- a/internal/engine/inputloader_integration_test.go +++ b/internal/engine/inputloader_integration_test.go @@ -9,7 +9,7 @@ import ( "github.com/apex/log" "github.com/google/go-cmp/cmp" engine "github.com/ooni/probe-cli/v3/internal/engine" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/model" ) diff --git a/internal/engine/internal/mockable/mockable.go b/internal/engine/internal/mockable/mockable.go index 57e6796c24..4ef037927b 100644 --- a/internal/engine/internal/mockable/mockable.go +++ b/internal/engine/internal/mockable/mockable.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/internal/psiphonx" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" "github.com/ooni/probe-cli/v3/internal/engine/internal/torx" diff --git a/internal/engine/internal/kvstore/kvstore.go b/internal/engine/kvstore/kvstore.go similarity index 100% rename from internal/engine/internal/kvstore/kvstore.go rename to internal/engine/kvstore/kvstore.go diff --git a/internal/engine/internal/kvstore/kvstore_test.go b/internal/engine/kvstore/kvstore_test.go similarity index 100% rename from internal/engine/internal/kvstore/kvstore_test.go rename to internal/engine/kvstore/kvstore_test.go diff --git a/internal/engine/netx/resolver/dnsoverhttps.go b/internal/engine/netx/resolver/dnsoverhttps.go index 50f10bcbe0..8041024490 100644 --- a/internal/engine/netx/resolver/dnsoverhttps.go +++ b/internal/engine/netx/resolver/dnsoverhttps.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" ) // DNSOverHTTPS is a DNS over HTTPS RoundTripper. Requests are submitted over diff --git a/internal/engine/netx/resolver/dnsoverhttps_test.go b/internal/engine/netx/resolver/dnsoverhttps_test.go index f02727f955..7747ad63c3 100644 --- a/internal/engine/netx/resolver/dnsoverhttps_test.go +++ b/internal/engine/netx/resolver/dnsoverhttps_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpheader" + "github.com/ooni/probe-cli/v3/internal/engine/httpheader" "github.com/ooni/probe-cli/v3/internal/engine/netx/resolver" ) diff --git a/internal/engine/probeservices/checkreportid.go b/internal/engine/probeservices/checkreportid.go index 4d53ddf58b..262f236529 100644 --- a/internal/engine/probeservices/checkreportid.go +++ b/internal/engine/probeservices/checkreportid.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) type checkReportIDResponse struct { diff --git a/internal/engine/probeservices/checkreportid_test.go b/internal/engine/probeservices/checkreportid_test.go index 292e439afc..d3fce64e92 100644 --- a/internal/engine/probeservices/checkreportid_test.go +++ b/internal/engine/probeservices/checkreportid_test.go @@ -8,8 +8,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" ) diff --git a/internal/engine/probeservices/measurementmeta.go b/internal/engine/probeservices/measurementmeta.go index de9cfbfb63..5024b876da 100644 --- a/internal/engine/probeservices/measurementmeta.go +++ b/internal/engine/probeservices/measurementmeta.go @@ -5,7 +5,7 @@ import ( "net/url" "time" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" ) // MeasurementMetaConfig contains configuration for GetMeasurementMeta. diff --git a/internal/engine/probeservices/measurementmeta_test.go b/internal/engine/probeservices/measurementmeta_test.go index cd92d5aa5b..c777d5dede 100644 --- a/internal/engine/probeservices/measurementmeta_test.go +++ b/internal/engine/probeservices/measurementmeta_test.go @@ -9,8 +9,8 @@ import ( "github.com/apex/log" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" ) diff --git a/internal/engine/probeservices/probeservices.go b/internal/engine/probeservices/probeservices.go index 10a138886a..ecbecdcc61 100644 --- a/internal/engine/probeservices/probeservices.go +++ b/internal/engine/probeservices/probeservices.go @@ -29,7 +29,7 @@ import ( "net/url" "github.com/ooni/probe-cli/v3/internal/engine/atomicx" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" "github.com/ooni/probe-cli/v3/internal/engine/model" ) diff --git a/internal/engine/probeservices/statefile_test.go b/internal/engine/probeservices/statefile_test.go index d6bfc88cb7..d274fbf241 100644 --- a/internal/engine/probeservices/statefile_test.go +++ b/internal/engine/probeservices/statefile_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/probeservices" ) diff --git a/internal/engine/resources/resources.go b/internal/engine/resources/resources.go index d41ba8e0df..d4afbaa72a 100644 --- a/internal/engine/resources/resources.go +++ b/internal/engine/resources/resources.go @@ -13,7 +13,7 @@ import ( "os" "path/filepath" - "github.com/ooni/probe-cli/v3/internal/engine/internal/httpx" + "github.com/ooni/probe-cli/v3/internal/engine/httpx" "github.com/ooni/probe-cli/v3/internal/engine/model" ) diff --git a/internal/engine/session.go b/internal/engine/session.go index 1fda2d2be3..6431f7b031 100644 --- a/internal/engine/session.go +++ b/internal/engine/session.go @@ -13,7 +13,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/atomicx" "github.com/ooni/probe-cli/v3/internal/engine/geolocate" - "github.com/ooni/probe-cli/v3/internal/engine/internal/kvstore" + "github.com/ooni/probe-cli/v3/internal/engine/kvstore" "github.com/ooni/probe-cli/v3/internal/engine/internal/platform" "github.com/ooni/probe-cli/v3/internal/engine/internal/sessionresolver" "github.com/ooni/probe-cli/v3/internal/engine/internal/tunnel" diff --git a/internal/engine/cmd/jafar/shellx/shellx.go b/internal/engine/shellx/shellx.go similarity index 100% rename from internal/engine/cmd/jafar/shellx/shellx.go rename to internal/engine/shellx/shellx.go diff --git a/internal/engine/cmd/jafar/shellx/shellx_test.go b/internal/engine/shellx/shellx_test.go similarity index 100% rename from internal/engine/cmd/jafar/shellx/shellx_test.go rename to internal/engine/shellx/shellx_test.go diff --git a/pkg/.gitignore b/pkg/.gitignore new file mode 100644 index 0000000000..ace1063ab0 --- /dev/null +++ b/pkg/.gitignore @@ -0,0 +1 @@ +/testdata