From 74ce92760c41f555f3f1e2d0e28778c5101351d0 Mon Sep 17 00:00:00 2001 From: Simon Aronsson Date: Sun, 21 Jul 2019 20:14:28 +0200 Subject: [PATCH] refactor: move container into pkg --- actions/actions_suite_test.go | 4 ++-- actions/check.go | 2 +- actions/update.go | 2 +- cmd/root.go | 2 +- {container => pkg/container}/client.go | 0 {container => pkg/container}/container.go | 0 {container => pkg/container}/container_test.go | 2 +- {container => pkg/container}/filters.go | 0 {container => pkg/container}/filters_test.go | 2 +- {container => pkg/container}/mocks/ApiServer.go | 0 {container => pkg/container}/mocks/FilterableContainer.go | 0 .../container}/mocks/data/container_running.json | 0 .../container}/mocks/data/container_stopped.json | 0 {container => pkg/container}/mocks/data/containers.json | 0 {container => pkg/container}/mocks/data/image01.json | 0 {container => pkg/container}/mocks/data/image02.json | 0 {container => pkg/container}/sort.go | 0 {container => pkg/container}/trust.go | 0 {container => pkg/container}/trust_test.go | 0 19 files changed, 7 insertions(+), 7 deletions(-) rename {container => pkg/container}/client.go (100%) rename {container => pkg/container}/container.go (100%) rename {container => pkg/container}/container_test.go (99%) rename {container => pkg/container}/filters.go (100%) rename {container => pkg/container}/filters_test.go (98%) rename {container => pkg/container}/mocks/ApiServer.go (100%) rename {container => pkg/container}/mocks/FilterableContainer.go (100%) rename {container => pkg/container}/mocks/data/container_running.json (100%) rename {container => pkg/container}/mocks/data/container_stopped.json (100%) rename {container => pkg/container}/mocks/data/containers.json (100%) rename {container => pkg/container}/mocks/data/image01.json (100%) rename {container => pkg/container}/mocks/data/image02.json (100%) rename {container => pkg/container}/sort.go (100%) rename {container => pkg/container}/trust.go (100%) rename {container => pkg/container}/trust_test.go (100%) diff --git a/actions/actions_suite_test.go b/actions/actions_suite_test.go index 0afab92..93fd417 100644 --- a/actions/actions_suite_test.go +++ b/actions/actions_suite_test.go @@ -6,8 +6,8 @@ import ( "time" "github.com/containrrr/watchtower/actions" - "github.com/containrrr/watchtower/container" - "github.com/containrrr/watchtower/container/mocks" + "github.com/containrrr/watchtower/pkg/container" + "github.com/containrrr/watchtower/pkg/container/mocks" "github.com/docker/docker/api/types" t "github.com/containrrr/watchtower/pkg/types" diff --git a/actions/check.go b/actions/check.go index 16fd42e..df052c8 100644 --- a/actions/check.go +++ b/actions/check.go @@ -11,7 +11,7 @@ import ( log "github.com/sirupsen/logrus" - "github.com/containrrr/watchtower/container" + "github.com/containrrr/watchtower/pkg/container" ) // CheckForMultipleWatchtowerInstances will ensure that there are not multiple instances of the diff --git a/actions/update.go b/actions/update.go index 8bfa14b..6827687 100644 --- a/actions/update.go +++ b/actions/update.go @@ -4,7 +4,7 @@ import ( "math/rand" "time" - "github.com/containrrr/watchtower/container" + "github.com/containrrr/watchtower/pkg/container" t "github.com/containrrr/watchtower/pkg/types" log "github.com/sirupsen/logrus" ) diff --git a/cmd/root.go b/cmd/root.go index 2514a0d..22a0d6d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -8,7 +8,7 @@ import ( "time" "github.com/containrrr/watchtower/actions" - "github.com/containrrr/watchtower/container" + "github.com/containrrr/watchtower/pkg/container" "github.com/containrrr/watchtower/internal/flags" "github.com/containrrr/watchtower/notifications" t "github.com/containrrr/watchtower/pkg/types" diff --git a/container/client.go b/pkg/container/client.go similarity index 100% rename from container/client.go rename to pkg/container/client.go diff --git a/container/container.go b/pkg/container/container.go similarity index 100% rename from container/container.go rename to pkg/container/container.go diff --git a/container/container_test.go b/pkg/container/container_test.go similarity index 99% rename from container/container_test.go rename to pkg/container/container_test.go index f9dd540..0cb8931 100644 --- a/container/container_test.go +++ b/pkg/container/container_test.go @@ -1,7 +1,7 @@ package container import ( - "github.com/containrrr/watchtower/container/mocks" + "github.com/containrrr/watchtower/pkg/container/mocks" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" cli "github.com/docker/docker/client" diff --git a/container/filters.go b/pkg/container/filters.go similarity index 100% rename from container/filters.go rename to pkg/container/filters.go diff --git a/container/filters_test.go b/pkg/container/filters_test.go similarity index 98% rename from container/filters_test.go rename to pkg/container/filters_test.go index 0db0a62..00ebae9 100644 --- a/container/filters_test.go +++ b/pkg/container/filters_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/containrrr/watchtower/container/mocks" + "github.com/containrrr/watchtower/pkg/container/mocks" ) func TestWatchtowerContainersFilter(t *testing.T) { diff --git a/container/mocks/ApiServer.go b/pkg/container/mocks/ApiServer.go similarity index 100% rename from container/mocks/ApiServer.go rename to pkg/container/mocks/ApiServer.go diff --git a/container/mocks/FilterableContainer.go b/pkg/container/mocks/FilterableContainer.go similarity index 100% rename from container/mocks/FilterableContainer.go rename to pkg/container/mocks/FilterableContainer.go diff --git a/container/mocks/data/container_running.json b/pkg/container/mocks/data/container_running.json similarity index 100% rename from container/mocks/data/container_running.json rename to pkg/container/mocks/data/container_running.json diff --git a/container/mocks/data/container_stopped.json b/pkg/container/mocks/data/container_stopped.json similarity index 100% rename from container/mocks/data/container_stopped.json rename to pkg/container/mocks/data/container_stopped.json diff --git a/container/mocks/data/containers.json b/pkg/container/mocks/data/containers.json similarity index 100% rename from container/mocks/data/containers.json rename to pkg/container/mocks/data/containers.json diff --git a/container/mocks/data/image01.json b/pkg/container/mocks/data/image01.json similarity index 100% rename from container/mocks/data/image01.json rename to pkg/container/mocks/data/image01.json diff --git a/container/mocks/data/image02.json b/pkg/container/mocks/data/image02.json similarity index 100% rename from container/mocks/data/image02.json rename to pkg/container/mocks/data/image02.json diff --git a/container/sort.go b/pkg/container/sort.go similarity index 100% rename from container/sort.go rename to pkg/container/sort.go diff --git a/container/trust.go b/pkg/container/trust.go similarity index 100% rename from container/trust.go rename to pkg/container/trust.go diff --git a/container/trust_test.go b/pkg/container/trust_test.go similarity index 100% rename from container/trust_test.go rename to pkg/container/trust_test.go