From a5f4fc997c53dca60a258f4b4eb6802c63db894c Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 3 Feb 2021 19:48:23 +0100 Subject: [PATCH] refactor: we don't wanna export pkg/oonimkall/tasks (#216) * doc: merge the engine and the cli readmes Part of https://github.com/ooni/probe/issues/1335 * refactor: we don't wanna export pkg/oonimkall/tasks See https://github.com/ooni/probe/issues/1335 --- pkg/oonimkall/.gitignore | 1 + pkg/oonimkall/{ => internal}/tasks/chanlogger.go | 0 pkg/oonimkall/{ => internal}/tasks/event.go | 0 pkg/oonimkall/{ => internal}/tasks/eventemitter.go | 0 pkg/oonimkall/{ => internal}/tasks/eventemitter_test.go | 2 +- pkg/oonimkall/{ => internal}/tasks/runner.go | 0 pkg/oonimkall/{ => internal}/tasks/runner_integration_test.go | 2 +- pkg/oonimkall/{ => internal}/tasks/runner_internal_test.go | 0 pkg/oonimkall/{ => internal}/tasks/settings.go | 0 pkg/oonimkall/task.go | 2 +- pkg/oonimkall/task_integration_test.go | 2 +- 11 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 pkg/oonimkall/.gitignore rename pkg/oonimkall/{ => internal}/tasks/chanlogger.go (100%) rename pkg/oonimkall/{ => internal}/tasks/event.go (100%) rename pkg/oonimkall/{ => internal}/tasks/eventemitter.go (100%) rename pkg/oonimkall/{ => internal}/tasks/eventemitter_test.go (95%) rename pkg/oonimkall/{ => internal}/tasks/runner.go (100%) rename pkg/oonimkall/{ => internal}/tasks/runner_integration_test.go (99%) rename pkg/oonimkall/{ => internal}/tasks/runner_internal_test.go (100%) rename pkg/oonimkall/{ => internal}/tasks/settings.go (100%) diff --git a/pkg/oonimkall/.gitignore b/pkg/oonimkall/.gitignore new file mode 100644 index 0000000000..ace1063ab0 --- /dev/null +++ b/pkg/oonimkall/.gitignore @@ -0,0 +1 @@ +/testdata diff --git a/pkg/oonimkall/tasks/chanlogger.go b/pkg/oonimkall/internal/tasks/chanlogger.go similarity index 100% rename from pkg/oonimkall/tasks/chanlogger.go rename to pkg/oonimkall/internal/tasks/chanlogger.go diff --git a/pkg/oonimkall/tasks/event.go b/pkg/oonimkall/internal/tasks/event.go similarity index 100% rename from pkg/oonimkall/tasks/event.go rename to pkg/oonimkall/internal/tasks/event.go diff --git a/pkg/oonimkall/tasks/eventemitter.go b/pkg/oonimkall/internal/tasks/eventemitter.go similarity index 100% rename from pkg/oonimkall/tasks/eventemitter.go rename to pkg/oonimkall/internal/tasks/eventemitter.go diff --git a/pkg/oonimkall/tasks/eventemitter_test.go b/pkg/oonimkall/internal/tasks/eventemitter_test.go similarity index 95% rename from pkg/oonimkall/tasks/eventemitter_test.go rename to pkg/oonimkall/internal/tasks/eventemitter_test.go index 308d8baa4f..63630e38af 100644 --- a/pkg/oonimkall/tasks/eventemitter_test.go +++ b/pkg/oonimkall/internal/tasks/eventemitter_test.go @@ -3,7 +3,7 @@ package tasks_test import ( "testing" - "github.com/ooni/probe-cli/v3/pkg/oonimkall/tasks" + "github.com/ooni/probe-cli/v3/pkg/oonimkall/internal/tasks" ) func TestDisabledEvents(t *testing.T) { diff --git a/pkg/oonimkall/tasks/runner.go b/pkg/oonimkall/internal/tasks/runner.go similarity index 100% rename from pkg/oonimkall/tasks/runner.go rename to pkg/oonimkall/internal/tasks/runner.go diff --git a/pkg/oonimkall/tasks/runner_integration_test.go b/pkg/oonimkall/internal/tasks/runner_integration_test.go similarity index 99% rename from pkg/oonimkall/tasks/runner_integration_test.go rename to pkg/oonimkall/internal/tasks/runner_integration_test.go index e8514b66fb..f50810803c 100644 --- a/pkg/oonimkall/tasks/runner_integration_test.go +++ b/pkg/oonimkall/internal/tasks/runner_integration_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ooni/probe-cli/v3/pkg/oonimkall/tasks" + "github.com/ooni/probe-cli/v3/pkg/oonimkall/internal/tasks" ) func TestRunnerMaybeLookupBackendsFailure(t *testing.T) { diff --git a/pkg/oonimkall/tasks/runner_internal_test.go b/pkg/oonimkall/internal/tasks/runner_internal_test.go similarity index 100% rename from pkg/oonimkall/tasks/runner_internal_test.go rename to pkg/oonimkall/internal/tasks/runner_internal_test.go diff --git a/pkg/oonimkall/tasks/settings.go b/pkg/oonimkall/internal/tasks/settings.go similarity index 100% rename from pkg/oonimkall/tasks/settings.go rename to pkg/oonimkall/internal/tasks/settings.go diff --git a/pkg/oonimkall/task.go b/pkg/oonimkall/task.go index 3e68e95c2f..1ad82db4e6 100644 --- a/pkg/oonimkall/task.go +++ b/pkg/oonimkall/task.go @@ -45,7 +45,7 @@ import ( "github.com/ooni/probe-cli/v3/internal/engine/atomicx" "github.com/ooni/probe-cli/v3/internal/engine/runtimex" - "github.com/ooni/probe-cli/v3/pkg/oonimkall/tasks" + "github.com/ooni/probe-cli/v3/pkg/oonimkall/internal/tasks" ) // Task is an asynchronous task running an experiment. It mimics the diff --git a/pkg/oonimkall/task_integration_test.go b/pkg/oonimkall/task_integration_test.go index 4e9282cd67..4bebd0ea96 100644 --- a/pkg/oonimkall/task_integration_test.go +++ b/pkg/oonimkall/task_integration_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/ooni/probe-cli/v3/internal/engine/model" "github.com/ooni/probe-cli/v3/pkg/oonimkall" - "github.com/ooni/probe-cli/v3/pkg/oonimkall/tasks" + "github.com/ooni/probe-cli/v3/pkg/oonimkall/internal/tasks" ) type eventlike struct {