From 14845a4a53f97fd183c2cc476dd736fa4dee4b64 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 21 Mar 2019 14:20:14 +1300 Subject: [PATCH] refactor(api): refactor base import path (#2788) * refactor(api): refactor base import path * fix(build-system): update build_binary_devops * fix(build-system): fix build_binary_devops for linux * fix(build-system): fix build_binary_devops for Windows --- api/bolt/datastore.go | 36 ++++++------- api/bolt/dockerhub/dockerhub.go | 4 +- api/bolt/endpoint/endpoint.go | 4 +- api/bolt/endpointgroup/endpointgroup.go | 4 +- api/bolt/extension/extension.go | 4 +- api/bolt/internal/db.go | 2 +- api/bolt/migrator/migrate_dbversion0.go | 4 +- api/bolt/migrator/migrate_dbversion1.go | 4 +- api/bolt/migrator/migrate_dbversion10.go | 2 +- api/bolt/migrator/migrate_dbversion11.go | 6 +-- api/bolt/migrator/migrate_dbversion12.go | 2 +- api/bolt/migrator/migrate_dbversion14.go | 2 +- api/bolt/migrator/migrate_dbversion2.go | 2 +- api/bolt/migrator/migrate_dbversion3.go | 2 +- api/bolt/migrator/migrate_dbversion7.go | 2 +- api/bolt/migrator/migrate_dbversion8.go | 2 +- api/bolt/migrator/migrate_dbversion9.go | 2 +- api/bolt/migrator/migrator.go | 20 +++---- api/bolt/registry/registry.go | 4 +- api/bolt/resourcecontrol/resourcecontrol.go | 4 +- api/bolt/schedule/schedule.go | 4 +- api/bolt/settings/settings.go | 4 +- api/bolt/stack/stack.go | 4 +- api/bolt/tag/tag.go | 4 +- api/bolt/team/team.go | 4 +- api/bolt/teammembership/teammembership.go | 4 +- api/bolt/template/template.go | 4 +- api/bolt/user/user.go | 4 +- api/bolt/version/version.go | 4 +- api/bolt/webhook/webhook.go | 4 +- api/cli/cli.go | 2 +- api/cli/pairlist.go | 2 +- api/cmd/portainer/main.go | 30 +++++------ api/cron/job_endpoint_sync.go | 2 +- api/cron/job_script_execution.go | 2 +- api/cron/job_snapshot.go | 2 +- api/cron/scheduler.go | 2 +- api/docker/client.go | 4 +- api/docker/job.go | 4 +- api/docker/snapshot.go | 2 +- api/docker/snapshotter.go | 2 +- api/exec/extension.go | 4 +- api/exec/swarm_stack.go | 2 +- api/filesystem/filesystem.go | 4 +- api/http/client/client.go | 2 +- api/http/handler/auth/authenticate.go | 2 +- api/http/handler/auth/authenticate_oauth.go | 2 +- api/http/handler/auth/handler.go | 6 +-- .../handler/dockerhub/dockerhub_update.go | 2 +- api/http/handler/dockerhub/handler.go | 4 +- .../endpointgroups/endpointgroup_create.go | 2 +- .../endpointgroups/endpointgroup_delete.go | 2 +- .../endpointgroups/endpointgroup_inspect.go | 2 +- .../endpointgroups/endpointgroup_list.go | 2 +- .../endpointgroups/endpointgroup_update.go | 2 +- .../endpointgroup_update_access.go | 2 +- api/http/handler/endpointgroups/handler.go | 4 +- api/http/handler/endpointproxy/handler.go | 6 +-- api/http/handler/endpointproxy/proxy_azure.go | 2 +- .../handler/endpointproxy/proxy_docker.go | 2 +- .../handler/endpointproxy/proxy_storidge.go | 2 +- api/http/handler/endpoints/endpoint_create.go | 6 +-- api/http/handler/endpoints/endpoint_delete.go | 2 +- .../endpoints/endpoint_extension_add.go | 2 +- .../endpoints/endpoint_extension_remove.go | 2 +- .../handler/endpoints/endpoint_inspect.go | 2 +- api/http/handler/endpoints/endpoint_job.go | 2 +- api/http/handler/endpoints/endpoint_list.go | 2 +- .../handler/endpoints/endpoint_snapshot.go | 2 +- .../handler/endpoints/endpoint_snapshots.go | 2 +- api/http/handler/endpoints/endpoint_update.go | 4 +- .../endpoints/endpoint_update_access.go | 2 +- api/http/handler/endpoints/handler.go | 6 +-- .../handler/extensions/extension_create.go | 2 +- .../handler/extensions/extension_delete.go | 2 +- .../handler/extensions/extension_inspect.go | 4 +- api/http/handler/extensions/extension_list.go | 2 +- .../handler/extensions/extension_update.go | 2 +- api/http/handler/extensions/handler.go | 4 +- api/http/handler/handler.go | 44 +++++++-------- api/http/handler/motd/handler.go | 2 +- api/http/handler/motd/motd.go | 6 +-- api/http/handler/registries/handler.go | 6 +-- api/http/handler/registries/proxy.go | 2 +- .../handler/registries/registry_configure.go | 2 +- .../handler/registries/registry_create.go | 2 +- .../handler/registries/registry_delete.go | 2 +- .../handler/registries/registry_inspect.go | 2 +- api/http/handler/registries/registry_list.go | 2 +- .../handler/registries/registry_update.go | 2 +- .../registries/registry_update_access.go | 2 +- api/http/handler/resourcecontrols/handler.go | 4 +- .../resourcecontrol_create.go | 4 +- .../resourcecontrol_delete.go | 4 +- .../resourcecontrol_update.go | 4 +- api/http/handler/schedules/handler.go | 4 +- api/http/handler/schedules/schedule_create.go | 4 +- api/http/handler/schedules/schedule_delete.go | 2 +- api/http/handler/schedules/schedule_file.go | 2 +- .../handler/schedules/schedule_inspect.go | 2 +- api/http/handler/schedules/schedule_list.go | 2 +- api/http/handler/schedules/schedule_tasks.go | 2 +- api/http/handler/schedules/schedule_update.go | 4 +- api/http/handler/settings/handler.go | 4 +- .../handler/settings/settings_ldap_check.go | 4 +- api/http/handler/settings/settings_public.go | 2 +- api/http/handler/settings/settings_update.go | 4 +- .../handler/stacks/create_compose_stack.go | 6 +-- api/http/handler/stacks/create_swarm_stack.go | 6 +-- api/http/handler/stacks/handler.go | 4 +- api/http/handler/stacks/stack_create.go | 2 +- api/http/handler/stacks/stack_delete.go | 6 +-- api/http/handler/stacks/stack_file.go | 6 +-- api/http/handler/stacks/stack_inspect.go | 6 +-- api/http/handler/stacks/stack_list.go | 6 +-- api/http/handler/stacks/stack_migrate.go | 6 +-- api/http/handler/stacks/stack_update.go | 6 +-- api/http/handler/status/handler.go | 4 +- api/http/handler/tags/handler.go | 4 +- api/http/handler/tags/tag_create.go | 2 +- api/http/handler/tags/tag_delete.go | 2 +- api/http/handler/teammemberships/handler.go | 4 +- .../teammemberships/teammembership_create.go | 4 +- .../teammemberships/teammembership_delete.go | 4 +- .../teammemberships/teammembership_list.go | 4 +- .../teammemberships/teammembership_update.go | 4 +- api/http/handler/teams/handler.go | 4 +- api/http/handler/teams/team_create.go | 2 +- api/http/handler/teams/team_delete.go | 2 +- api/http/handler/teams/team_inspect.go | 4 +- api/http/handler/teams/team_list.go | 2 +- api/http/handler/teams/team_memberships.go | 4 +- api/http/handler/teams/team_update.go | 2 +- api/http/handler/templates/handler.go | 4 +- api/http/handler/templates/template_create.go | 4 +- api/http/handler/templates/template_delete.go | 2 +- .../handler/templates/template_inspect.go | 2 +- api/http/handler/templates/template_list.go | 6 +-- api/http/handler/templates/template_update.go | 2 +- api/http/handler/upload/handler.go | 4 +- api/http/handler/upload/upload_tls.go | 2 +- api/http/handler/users/admin_check.go | 2 +- api/http/handler/users/admin_init.go | 2 +- api/http/handler/users/handler.go | 4 +- api/http/handler/users/user_create.go | 4 +- api/http/handler/users/user_delete.go | 4 +- api/http/handler/users/user_inspect.go | 2 +- api/http/handler/users/user_list.go | 2 +- api/http/handler/users/user_memberships.go | 4 +- api/http/handler/users/user_update.go | 4 +- .../handler/users/user_update_password.go | 4 +- api/http/handler/webhooks/handler.go | 6 +-- api/http/handler/webhooks/webhook_create.go | 2 +- api/http/handler/webhooks/webhook_delete.go | 2 +- api/http/handler/webhooks/webhook_execute.go | 2 +- api/http/handler/webhooks/webhook_list.go | 2 +- api/http/handler/websocket/handler.go | 4 +- api/http/handler/websocket/websocket_exec.go | 4 +- api/http/proxy/access_control.go | 2 +- api/http/proxy/azure_transport.go | 4 +- api/http/proxy/build.go | 2 +- api/http/proxy/configs.go | 2 +- api/http/proxy/containers.go | 2 +- api/http/proxy/docker_transport.go | 4 +- api/http/proxy/factory.go | 4 +- api/http/proxy/manager.go | 2 +- api/http/proxy/networks.go | 2 +- api/http/proxy/registry.go | 4 +- api/http/proxy/response.go | 2 +- api/http/proxy/secrets.go | 2 +- api/http/proxy/services.go | 2 +- api/http/proxy/tasks.go | 2 +- api/http/proxy/volumes.go | 2 +- api/http/security/authorization.go | 2 +- api/http/security/bouncer.go | 2 +- api/http/security/context.go | 2 +- api/http/security/filter.go | 2 +- api/http/security/rate_limiter.go | 2 +- api/http/server.go | 54 +++++++++---------- api/jwt/jwt.go | 2 +- api/ldap/ldap.go | 4 +- api/libcompose/compose_stack.go | 2 +- build/build_binary_devops.ps1 | 5 +- build/build_binary_devops.sh | 6 +-- 184 files changed, 372 insertions(+), 373 deletions(-) diff --git a/api/bolt/datastore.go b/api/bolt/datastore.go index 85273c23b..c4ef68423 100644 --- a/api/bolt/datastore.go +++ b/api/bolt/datastore.go @@ -6,24 +6,24 @@ import ( "time" "github.com/boltdb/bolt" - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/dockerhub" - "github.com/portainer/portainer/bolt/endpoint" - "github.com/portainer/portainer/bolt/endpointgroup" - "github.com/portainer/portainer/bolt/extension" - "github.com/portainer/portainer/bolt/migrator" - "github.com/portainer/portainer/bolt/registry" - "github.com/portainer/portainer/bolt/resourcecontrol" - "github.com/portainer/portainer/bolt/schedule" - "github.com/portainer/portainer/bolt/settings" - "github.com/portainer/portainer/bolt/stack" - "github.com/portainer/portainer/bolt/tag" - "github.com/portainer/portainer/bolt/team" - "github.com/portainer/portainer/bolt/teammembership" - "github.com/portainer/portainer/bolt/template" - "github.com/portainer/portainer/bolt/user" - "github.com/portainer/portainer/bolt/version" - "github.com/portainer/portainer/bolt/webhook" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/dockerhub" + "github.com/portainer/portainer/api/bolt/endpoint" + "github.com/portainer/portainer/api/bolt/endpointgroup" + "github.com/portainer/portainer/api/bolt/extension" + "github.com/portainer/portainer/api/bolt/migrator" + "github.com/portainer/portainer/api/bolt/registry" + "github.com/portainer/portainer/api/bolt/resourcecontrol" + "github.com/portainer/portainer/api/bolt/schedule" + "github.com/portainer/portainer/api/bolt/settings" + "github.com/portainer/portainer/api/bolt/stack" + "github.com/portainer/portainer/api/bolt/tag" + "github.com/portainer/portainer/api/bolt/team" + "github.com/portainer/portainer/api/bolt/teammembership" + "github.com/portainer/portainer/api/bolt/template" + "github.com/portainer/portainer/api/bolt/user" + "github.com/portainer/portainer/api/bolt/version" + "github.com/portainer/portainer/api/bolt/webhook" ) const ( diff --git a/api/bolt/dockerhub/dockerhub.go b/api/bolt/dockerhub/dockerhub.go index 0e4b4858c..a225be462 100644 --- a/api/bolt/dockerhub/dockerhub.go +++ b/api/bolt/dockerhub/dockerhub.go @@ -1,8 +1,8 @@ package dockerhub import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/endpoint/endpoint.go b/api/bolt/endpoint/endpoint.go index 6dfff48df..723c2046b 100644 --- a/api/bolt/endpoint/endpoint.go +++ b/api/bolt/endpoint/endpoint.go @@ -1,8 +1,8 @@ package endpoint import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/endpointgroup/endpointgroup.go b/api/bolt/endpointgroup/endpointgroup.go index 89398dbd5..3311e88cb 100644 --- a/api/bolt/endpointgroup/endpointgroup.go +++ b/api/bolt/endpointgroup/endpointgroup.go @@ -1,8 +1,8 @@ package endpointgroup import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/extension/extension.go b/api/bolt/extension/extension.go index e60963f97..83e225414 100644 --- a/api/bolt/extension/extension.go +++ b/api/bolt/extension/extension.go @@ -1,8 +1,8 @@ package extension import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/internal/db.go b/api/bolt/internal/db.go index 59ca7c87d..8cbb1d2d0 100644 --- a/api/bolt/internal/db.go +++ b/api/bolt/internal/db.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "github.com/boltdb/bolt" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // Itob returns an 8-byte big endian representation of v. diff --git a/api/bolt/migrator/migrate_dbversion0.go b/api/bolt/migrator/migrate_dbversion0.go index 4c2bdff12..04d1a93b5 100644 --- a/api/bolt/migrator/migrate_dbversion0.go +++ b/api/bolt/migrator/migrate_dbversion0.go @@ -2,8 +2,8 @@ package migrator import ( "github.com/boltdb/bolt" - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/user" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/user" ) func (m *Migrator) updateAdminUserToDBVersion1() error { diff --git a/api/bolt/migrator/migrate_dbversion1.go b/api/bolt/migrator/migrate_dbversion1.go index 063f58dc7..0b52d83b8 100644 --- a/api/bolt/migrator/migrate_dbversion1.go +++ b/api/bolt/migrator/migrate_dbversion1.go @@ -2,8 +2,8 @@ package migrator import ( "github.com/boltdb/bolt" - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" ) func (m *Migrator) updateResourceControlsToDBVersion2() error { diff --git a/api/bolt/migrator/migrate_dbversion10.go b/api/bolt/migrator/migrate_dbversion10.go index da55e3962..38a989207 100644 --- a/api/bolt/migrator/migrate_dbversion10.go +++ b/api/bolt/migrator/migrate_dbversion10.go @@ -1,6 +1,6 @@ package migrator -import "github.com/portainer/portainer" +import "github.com/portainer/portainer/api" func (m *Migrator) updateEndpointsToVersion11() error { legacyEndpoints, err := m.endpointService.Endpoints() diff --git a/api/bolt/migrator/migrate_dbversion11.go b/api/bolt/migrator/migrate_dbversion11.go index 168d23984..8acaefc2e 100644 --- a/api/bolt/migrator/migrate_dbversion11.go +++ b/api/bolt/migrator/migrate_dbversion11.go @@ -5,9 +5,9 @@ import ( "strings" "github.com/boltdb/bolt" - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" - "github.com/portainer/portainer/bolt/stack" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" + "github.com/portainer/portainer/api/bolt/stack" ) func (m *Migrator) updateEndpointsToVersion12() error { diff --git a/api/bolt/migrator/migrate_dbversion12.go b/api/bolt/migrator/migrate_dbversion12.go index 0d2bf0554..ba180ca56 100644 --- a/api/bolt/migrator/migrate_dbversion12.go +++ b/api/bolt/migrator/migrate_dbversion12.go @@ -1,6 +1,6 @@ package migrator -import "github.com/portainer/portainer" +import "github.com/portainer/portainer/api" func (m *Migrator) updateSettingsToVersion13() error { legacySettings, err := m.settingsService.Settings() diff --git a/api/bolt/migrator/migrate_dbversion14.go b/api/bolt/migrator/migrate_dbversion14.go index ebaa4495e..5ec13cd9f 100644 --- a/api/bolt/migrator/migrate_dbversion14.go +++ b/api/bolt/migrator/migrate_dbversion14.go @@ -3,7 +3,7 @@ package migrator import ( "strings" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) func (m *Migrator) updateSettingsToDBVersion15() error { diff --git a/api/bolt/migrator/migrate_dbversion2.go b/api/bolt/migrator/migrate_dbversion2.go index 9488f50f9..07eaf1d24 100644 --- a/api/bolt/migrator/migrate_dbversion2.go +++ b/api/bolt/migrator/migrate_dbversion2.go @@ -1,6 +1,6 @@ package migrator -import "github.com/portainer/portainer" +import "github.com/portainer/portainer/api" func (m *Migrator) updateSettingsToDBVersion3() error { legacySettings, err := m.settingsService.Settings() diff --git a/api/bolt/migrator/migrate_dbversion3.go b/api/bolt/migrator/migrate_dbversion3.go index 75636dc97..cfe9d5715 100644 --- a/api/bolt/migrator/migrate_dbversion3.go +++ b/api/bolt/migrator/migrate_dbversion3.go @@ -1,6 +1,6 @@ package migrator -import "github.com/portainer/portainer" +import "github.com/portainer/portainer/api" func (m *Migrator) updateEndpointsToDBVersion4() error { legacyEndpoints, err := m.endpointService.Endpoints() diff --git a/api/bolt/migrator/migrate_dbversion7.go b/api/bolt/migrator/migrate_dbversion7.go index b248e9e42..b0672a609 100644 --- a/api/bolt/migrator/migrate_dbversion7.go +++ b/api/bolt/migrator/migrate_dbversion7.go @@ -1,6 +1,6 @@ package migrator -import "github.com/portainer/portainer" +import "github.com/portainer/portainer/api" func (m *Migrator) updateEndpointsToVersion8() error { legacyEndpoints, err := m.endpointService.Endpoints() diff --git a/api/bolt/migrator/migrate_dbversion8.go b/api/bolt/migrator/migrate_dbversion8.go index 99a73bf11..a9fff2da4 100644 --- a/api/bolt/migrator/migrate_dbversion8.go +++ b/api/bolt/migrator/migrate_dbversion8.go @@ -1,6 +1,6 @@ package migrator -import "github.com/portainer/portainer" +import "github.com/portainer/portainer/api" func (m *Migrator) updateEndpointsToVersion9() error { legacyEndpoints, err := m.endpointService.Endpoints() diff --git a/api/bolt/migrator/migrate_dbversion9.go b/api/bolt/migrator/migrate_dbversion9.go index f4a52d398..1b3fbadfe 100644 --- a/api/bolt/migrator/migrate_dbversion9.go +++ b/api/bolt/migrator/migrate_dbversion9.go @@ -1,6 +1,6 @@ package migrator -import "github.com/portainer/portainer" +import "github.com/portainer/portainer/api" func (m *Migrator) updateEndpointsToVersion10() error { legacyEndpoints, err := m.endpointService.Endpoints() diff --git a/api/bolt/migrator/migrator.go b/api/bolt/migrator/migrator.go index ccee735ff..705de70b7 100644 --- a/api/bolt/migrator/migrator.go +++ b/api/bolt/migrator/migrator.go @@ -2,16 +2,16 @@ package migrator import ( "github.com/boltdb/bolt" - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/endpoint" - "github.com/portainer/portainer/bolt/endpointgroup" - "github.com/portainer/portainer/bolt/extension" - "github.com/portainer/portainer/bolt/resourcecontrol" - "github.com/portainer/portainer/bolt/settings" - "github.com/portainer/portainer/bolt/stack" - "github.com/portainer/portainer/bolt/template" - "github.com/portainer/portainer/bolt/user" - "github.com/portainer/portainer/bolt/version" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/endpoint" + "github.com/portainer/portainer/api/bolt/endpointgroup" + "github.com/portainer/portainer/api/bolt/extension" + "github.com/portainer/portainer/api/bolt/resourcecontrol" + "github.com/portainer/portainer/api/bolt/settings" + "github.com/portainer/portainer/api/bolt/stack" + "github.com/portainer/portainer/api/bolt/template" + "github.com/portainer/portainer/api/bolt/user" + "github.com/portainer/portainer/api/bolt/version" ) type ( diff --git a/api/bolt/registry/registry.go b/api/bolt/registry/registry.go index 2fbfbeb90..428c6957e 100644 --- a/api/bolt/registry/registry.go +++ b/api/bolt/registry/registry.go @@ -1,8 +1,8 @@ package registry import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/resourcecontrol/resourcecontrol.go b/api/bolt/resourcecontrol/resourcecontrol.go index 222bafd79..d4fdb3026 100644 --- a/api/bolt/resourcecontrol/resourcecontrol.go +++ b/api/bolt/resourcecontrol/resourcecontrol.go @@ -1,8 +1,8 @@ package resourcecontrol import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/schedule/schedule.go b/api/bolt/schedule/schedule.go index db824768f..25b996373 100644 --- a/api/bolt/schedule/schedule.go +++ b/api/bolt/schedule/schedule.go @@ -1,8 +1,8 @@ package schedule import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/settings/settings.go b/api/bolt/settings/settings.go index 6e1d4bc82..c14032b25 100644 --- a/api/bolt/settings/settings.go +++ b/api/bolt/settings/settings.go @@ -1,8 +1,8 @@ package settings import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/stack/stack.go b/api/bolt/stack/stack.go index 1bd8e159b..54d5facd1 100644 --- a/api/bolt/stack/stack.go +++ b/api/bolt/stack/stack.go @@ -1,8 +1,8 @@ package stack import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/tag/tag.go b/api/bolt/tag/tag.go index 796b463dd..d54ee6b76 100644 --- a/api/bolt/tag/tag.go +++ b/api/bolt/tag/tag.go @@ -1,8 +1,8 @@ package tag import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/team/team.go b/api/bolt/team/team.go index 189a16a8a..d77aed90e 100644 --- a/api/bolt/team/team.go +++ b/api/bolt/team/team.go @@ -1,8 +1,8 @@ package team import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/teammembership/teammembership.go b/api/bolt/teammembership/teammembership.go index 2f09e0ad7..af60db0d2 100644 --- a/api/bolt/teammembership/teammembership.go +++ b/api/bolt/teammembership/teammembership.go @@ -1,8 +1,8 @@ package teammembership import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/template/template.go b/api/bolt/template/template.go index d60f64c0e..e5f7a4cf5 100644 --- a/api/bolt/template/template.go +++ b/api/bolt/template/template.go @@ -1,8 +1,8 @@ package template import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/user/user.go b/api/bolt/user/user.go index 03a3a8d88..63e3dfdc9 100644 --- a/api/bolt/user/user.go +++ b/api/bolt/user/user.go @@ -1,8 +1,8 @@ package user import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/bolt/version/version.go b/api/bolt/version/version.go index 52a7b4be4..18e9ab6d5 100644 --- a/api/bolt/version/version.go +++ b/api/bolt/version/version.go @@ -4,8 +4,8 @@ import ( "strconv" "github.com/boltdb/bolt" - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" ) const ( diff --git a/api/bolt/webhook/webhook.go b/api/bolt/webhook/webhook.go index 94ebe61c5..38377cdb4 100644 --- a/api/bolt/webhook/webhook.go +++ b/api/bolt/webhook/webhook.go @@ -1,8 +1,8 @@ package webhook import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt/internal" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt/internal" "github.com/boltdb/bolt" ) diff --git a/api/cli/cli.go b/api/cli/cli.go index 7c6febac2..6eef1a432 100644 --- a/api/cli/cli.go +++ b/api/cli/cli.go @@ -3,7 +3,7 @@ package cli import ( "time" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "os" "path/filepath" diff --git a/api/cli/pairlist.go b/api/cli/pairlist.go index 7c1d4ea58..1eb6d10df 100644 --- a/api/cli/pairlist.go +++ b/api/cli/pairlist.go @@ -1,7 +1,7 @@ package cli import ( - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "fmt" "gopkg.in/alecthomas/kingpin.v2" diff --git a/api/cmd/portainer/main.go b/api/cmd/portainer/main.go index f759285da..f0a13ebdc 100644 --- a/api/cmd/portainer/main.go +++ b/api/cmd/portainer/main.go @@ -1,4 +1,4 @@ -package main // import "github.com/portainer/portainer" +package main import ( "encoding/json" @@ -6,20 +6,20 @@ import ( "strings" "time" - "github.com/portainer/portainer" - "github.com/portainer/portainer/bolt" - "github.com/portainer/portainer/cli" - "github.com/portainer/portainer/cron" - "github.com/portainer/portainer/crypto" - "github.com/portainer/portainer/docker" - "github.com/portainer/portainer/exec" - "github.com/portainer/portainer/filesystem" - "github.com/portainer/portainer/git" - "github.com/portainer/portainer/http" - "github.com/portainer/portainer/http/client" - "github.com/portainer/portainer/jwt" - "github.com/portainer/portainer/ldap" - "github.com/portainer/portainer/libcompose" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/bolt" + "github.com/portainer/portainer/api/cli" + "github.com/portainer/portainer/api/cron" + "github.com/portainer/portainer/api/crypto" + "github.com/portainer/portainer/api/docker" + "github.com/portainer/portainer/api/exec" + "github.com/portainer/portainer/api/filesystem" + "github.com/portainer/portainer/api/git" + "github.com/portainer/portainer/api/http" + "github.com/portainer/portainer/api/http/client" + "github.com/portainer/portainer/api/jwt" + "github.com/portainer/portainer/api/ldap" + "github.com/portainer/portainer/api/libcompose" "log" ) diff --git a/api/cron/job_endpoint_sync.go b/api/cron/job_endpoint_sync.go index ef13a4970..361698649 100644 --- a/api/cron/job_endpoint_sync.go +++ b/api/cron/job_endpoint_sync.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // EndpointSyncJobRunner is used to run a EndpointSyncJob diff --git a/api/cron/job_script_execution.go b/api/cron/job_script_execution.go index 2143a83f5..f9634813f 100644 --- a/api/cron/job_script_execution.go +++ b/api/cron/job_script_execution.go @@ -4,7 +4,7 @@ import ( "log" "time" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // ScriptExecutionJobRunner is used to run a ScriptExecutionJob diff --git a/api/cron/job_snapshot.go b/api/cron/job_snapshot.go index 513a324b9..c7828b164 100644 --- a/api/cron/job_snapshot.go +++ b/api/cron/job_snapshot.go @@ -3,7 +3,7 @@ package cron import ( "log" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // SnapshotJobRunner is used to run a SnapshotJob diff --git a/api/cron/scheduler.go b/api/cron/scheduler.go index 144e5ed2f..9a2de7450 100644 --- a/api/cron/scheduler.go +++ b/api/cron/scheduler.go @@ -1,7 +1,7 @@ package cron import ( - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "github.com/robfig/cron" ) diff --git a/api/docker/client.go b/api/docker/client.go index 421f92c04..9dcdf33dc 100644 --- a/api/docker/client.go +++ b/api/docker/client.go @@ -6,8 +6,8 @@ import ( "time" "github.com/docker/docker/client" - "github.com/portainer/portainer" - "github.com/portainer/portainer/crypto" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/crypto" ) const ( diff --git a/api/docker/job.go b/api/docker/job.go index 7765f5f2e..ff6dae2c2 100644 --- a/api/docker/job.go +++ b/api/docker/job.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types/network" "github.com/docker/docker/api/types/strslice" "github.com/docker/docker/client" - "github.com/portainer/portainer" - "github.com/portainer/portainer/archive" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/archive" ) // JobService represents a service that handles the execution of jobs diff --git a/api/docker/snapshot.go b/api/docker/snapshot.go index 342465b1f..e03a76496 100644 --- a/api/docker/snapshot.go +++ b/api/docker/snapshot.go @@ -7,7 +7,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) func snapshot(cli *client.Client) (*portainer.Snapshot, error) { diff --git a/api/docker/snapshotter.go b/api/docker/snapshotter.go index ee095f6d5..24d121845 100644 --- a/api/docker/snapshotter.go +++ b/api/docker/snapshotter.go @@ -1,7 +1,7 @@ package docker import ( - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // Snapshotter represents a service used to create endpoint snapshots diff --git a/api/exec/extension.go b/api/exec/extension.go index ab7880a1b..3eec0a9e1 100644 --- a/api/exec/extension.go +++ b/api/exec/extension.go @@ -11,8 +11,8 @@ import ( "strings" "github.com/orcaman/concurrent-map" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/client" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/client" ) var extensionDownloadBaseURL = "https://portainer-io-assets.sfo2.digitaloceanspaces.com/extensions/" diff --git a/api/exec/swarm_stack.go b/api/exec/swarm_stack.go index da781b030..3f01bbb26 100644 --- a/api/exec/swarm_stack.go +++ b/api/exec/swarm_stack.go @@ -8,7 +8,7 @@ import ( "path" "runtime" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // SwarmStackManager represents a service for managing stacks. diff --git a/api/filesystem/filesystem.go b/api/filesystem/filesystem.go index dcb397eac..cf4e06977 100644 --- a/api/filesystem/filesystem.go +++ b/api/filesystem/filesystem.go @@ -6,8 +6,8 @@ import ( "encoding/pem" "io/ioutil" - "github.com/portainer/portainer" - "github.com/portainer/portainer/archive" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/archive" "io" "os" diff --git a/api/http/client/client.go b/api/http/client/client.go index 8892b6472..11b812a86 100644 --- a/api/http/client/client.go +++ b/api/http/client/client.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/handler/auth/authenticate.go b/api/http/handler/auth/authenticate.go index d5562edd3..1dcb8c774 100644 --- a/api/http/handler/auth/authenticate.go +++ b/api/http/handler/auth/authenticate.go @@ -9,7 +9,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type authenticatePayload struct { diff --git a/api/http/handler/auth/authenticate_oauth.go b/api/http/handler/auth/authenticate_oauth.go index d8559e999..91d0d4fcc 100644 --- a/api/http/handler/auth/authenticate_oauth.go +++ b/api/http/handler/auth/authenticate_oauth.go @@ -9,7 +9,7 @@ import ( "github.com/asaskevich/govalidator" httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type oauthPayload struct { diff --git a/api/http/handler/auth/handler.go b/api/http/handler/auth/handler.go index 75e343f23..ebf001132 100644 --- a/api/http/handler/auth/handler.go +++ b/api/http/handler/auth/handler.go @@ -5,9 +5,9 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) const ( diff --git a/api/http/handler/dockerhub/dockerhub_update.go b/api/http/handler/dockerhub/dockerhub_update.go index 69d82ee50..5606677fb 100644 --- a/api/http/handler/dockerhub/dockerhub_update.go +++ b/api/http/handler/dockerhub/dockerhub_update.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type dockerhubUpdatePayload struct { diff --git a/api/http/handler/dockerhub/handler.go b/api/http/handler/dockerhub/handler.go index 9ad93232d..5821e4219 100644 --- a/api/http/handler/dockerhub/handler.go +++ b/api/http/handler/dockerhub/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) func hideFields(dockerHub *portainer.DockerHub) { diff --git a/api/http/handler/endpointgroups/endpointgroup_create.go b/api/http/handler/endpointgroups/endpointgroup_create.go index cc7a23054..a5f3fe8a4 100644 --- a/api/http/handler/endpointgroups/endpointgroup_create.go +++ b/api/http/handler/endpointgroups/endpointgroup_create.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type endpointGroupCreatePayload struct { diff --git a/api/http/handler/endpointgroups/endpointgroup_delete.go b/api/http/handler/endpointgroups/endpointgroup_delete.go index b436b4f2f..a7a3c0a79 100644 --- a/api/http/handler/endpointgroups/endpointgroup_delete.go +++ b/api/http/handler/endpointgroups/endpointgroup_delete.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/endpoint_groups/:id diff --git a/api/http/handler/endpointgroups/endpointgroup_inspect.go b/api/http/handler/endpointgroups/endpointgroup_inspect.go index 46a6895e8..3ddc464e7 100644 --- a/api/http/handler/endpointgroups/endpointgroup_inspect.go +++ b/api/http/handler/endpointgroups/endpointgroup_inspect.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // GET request on /api/endpoint_groups/:id diff --git a/api/http/handler/endpointgroups/endpointgroup_list.go b/api/http/handler/endpointgroups/endpointgroup_list.go index 7acb696a8..7ea73d2d5 100644 --- a/api/http/handler/endpointgroups/endpointgroup_list.go +++ b/api/http/handler/endpointgroups/endpointgroup_list.go @@ -5,7 +5,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/endpoint_groups diff --git a/api/http/handler/endpointgroups/endpointgroup_update.go b/api/http/handler/endpointgroups/endpointgroup_update.go index ec24b801f..a08c6b101 100644 --- a/api/http/handler/endpointgroups/endpointgroup_update.go +++ b/api/http/handler/endpointgroups/endpointgroup_update.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type endpointGroupUpdatePayload struct { diff --git a/api/http/handler/endpointgroups/endpointgroup_update_access.go b/api/http/handler/endpointgroups/endpointgroup_update_access.go index 6e859a4df..369583f4f 100644 --- a/api/http/handler/endpointgroups/endpointgroup_update_access.go +++ b/api/http/handler/endpointgroups/endpointgroup_update_access.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type endpointGroupUpdateAccessPayload struct { diff --git a/api/http/handler/endpointgroups/handler.go b/api/http/handler/endpointgroups/handler.go index 3b731e911..3233a74df 100644 --- a/api/http/handler/endpointgroups/handler.go +++ b/api/http/handler/endpointgroups/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle endpoint group operations. diff --git a/api/http/handler/endpointproxy/handler.go b/api/http/handler/endpointproxy/handler.go index eaef36b1b..4bb7560a9 100644 --- a/api/http/handler/endpointproxy/handler.go +++ b/api/http/handler/endpointproxy/handler.go @@ -3,9 +3,9 @@ package endpointproxy import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to proxy requests to external APIs. diff --git a/api/http/handler/endpointproxy/proxy_azure.go b/api/http/handler/endpointproxy/proxy_azure.go index dcbe96f4b..1b5539916 100644 --- a/api/http/handler/endpointproxy/proxy_azure.go +++ b/api/http/handler/endpointproxy/proxy_azure.go @@ -5,7 +5,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "net/http" ) diff --git a/api/http/handler/endpointproxy/proxy_docker.go b/api/http/handler/endpointproxy/proxy_docker.go index 9ca932a97..7a0834c82 100644 --- a/api/http/handler/endpointproxy/proxy_docker.go +++ b/api/http/handler/endpointproxy/proxy_docker.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "net/http" ) diff --git a/api/http/handler/endpointproxy/proxy_storidge.go b/api/http/handler/endpointproxy/proxy_storidge.go index 697d74ff5..497fef198 100644 --- a/api/http/handler/endpointproxy/proxy_storidge.go +++ b/api/http/handler/endpointproxy/proxy_storidge.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "net/http" ) diff --git a/api/http/handler/endpoints/endpoint_create.go b/api/http/handler/endpoints/endpoint_create.go index a3eeeb114..34e06cca4 100644 --- a/api/http/handler/endpoints/endpoint_create.go +++ b/api/http/handler/endpoints/endpoint_create.go @@ -9,9 +9,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/crypto" - "github.com/portainer/portainer/http/client" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/crypto" + "github.com/portainer/portainer/api/http/client" ) type endpointCreatePayload struct { diff --git a/api/http/handler/endpoints/endpoint_delete.go b/api/http/handler/endpoints/endpoint_delete.go index 3b34db01e..0dd25963c 100644 --- a/api/http/handler/endpoints/endpoint_delete.go +++ b/api/http/handler/endpoints/endpoint_delete.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/endpoints/:id diff --git a/api/http/handler/endpoints/endpoint_extension_add.go b/api/http/handler/endpoints/endpoint_extension_add.go index 7c2f69e3a..a7d152058 100644 --- a/api/http/handler/endpoints/endpoint_extension_add.go +++ b/api/http/handler/endpoints/endpoint_extension_add.go @@ -9,7 +9,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type endpointExtensionAddPayload struct { diff --git a/api/http/handler/endpoints/endpoint_extension_remove.go b/api/http/handler/endpoints/endpoint_extension_remove.go index 3f68955cc..b426071e0 100644 --- a/api/http/handler/endpoints/endpoint_extension_remove.go +++ b/api/http/handler/endpoints/endpoint_extension_remove.go @@ -8,7 +8,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/endpoints/:id/extensions/:extensionType diff --git a/api/http/handler/endpoints/endpoint_inspect.go b/api/http/handler/endpoints/endpoint_inspect.go index dd0d3485b..c21b92d5a 100644 --- a/api/http/handler/endpoints/endpoint_inspect.go +++ b/api/http/handler/endpoints/endpoint_inspect.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // GET request on /api/endpoints/:id diff --git a/api/http/handler/endpoints/endpoint_job.go b/api/http/handler/endpoints/endpoint_job.go index 565418f42..c7219a35e 100644 --- a/api/http/handler/endpoints/endpoint_job.go +++ b/api/http/handler/endpoints/endpoint_job.go @@ -8,7 +8,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type endpointJobFromFilePayload struct { diff --git a/api/http/handler/endpoints/endpoint_list.go b/api/http/handler/endpoints/endpoint_list.go index 5c1436ac9..d7e1ba173 100644 --- a/api/http/handler/endpoints/endpoint_list.go +++ b/api/http/handler/endpoints/endpoint_list.go @@ -5,7 +5,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/endpoints diff --git a/api/http/handler/endpoints/endpoint_snapshot.go b/api/http/handler/endpoints/endpoint_snapshot.go index 559cf127c..de3eba46c 100644 --- a/api/http/handler/endpoints/endpoint_snapshot.go +++ b/api/http/handler/endpoints/endpoint_snapshot.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // POST request on /api/endpoints/:id/snapshot diff --git a/api/http/handler/endpoints/endpoint_snapshots.go b/api/http/handler/endpoints/endpoint_snapshots.go index f59b7a40d..e25be6f89 100644 --- a/api/http/handler/endpoints/endpoint_snapshots.go +++ b/api/http/handler/endpoints/endpoint_snapshots.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // POST request on /api/endpoints/snapshot diff --git a/api/http/handler/endpoints/endpoint_update.go b/api/http/handler/endpoints/endpoint_update.go index 405f6ce38..9adb95bca 100644 --- a/api/http/handler/endpoints/endpoint_update.go +++ b/api/http/handler/endpoints/endpoint_update.go @@ -7,8 +7,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/client" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/client" ) type endpointUpdatePayload struct { diff --git a/api/http/handler/endpoints/endpoint_update_access.go b/api/http/handler/endpoints/endpoint_update_access.go index 47a7d414b..980ed7651 100644 --- a/api/http/handler/endpoints/endpoint_update_access.go +++ b/api/http/handler/endpoints/endpoint_update_access.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type endpointUpdateAccessPayload struct { diff --git a/api/http/handler/endpoints/handler.go b/api/http/handler/endpoints/handler.go index d8a94d360..fe0a889fb 100644 --- a/api/http/handler/endpoints/handler.go +++ b/api/http/handler/endpoints/handler.go @@ -2,9 +2,9 @@ package endpoints import ( httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" "net/http" diff --git a/api/http/handler/extensions/extension_create.go b/api/http/handler/extensions/extension_create.go index 22d146f6e..d3a2d881d 100644 --- a/api/http/handler/extensions/extension_create.go +++ b/api/http/handler/extensions/extension_create.go @@ -8,7 +8,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type extensionCreatePayload struct { diff --git a/api/http/handler/extensions/extension_delete.go b/api/http/handler/extensions/extension_delete.go index be9d72bb3..6f59afc2b 100644 --- a/api/http/handler/extensions/extension_delete.go +++ b/api/http/handler/extensions/extension_delete.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/extensions/:id diff --git a/api/http/handler/extensions/extension_inspect.go b/api/http/handler/extensions/extension_inspect.go index 712e4403e..74ac59254 100644 --- a/api/http/handler/extensions/extension_inspect.go +++ b/api/http/handler/extensions/extension_inspect.go @@ -8,8 +8,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/client" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/client" ) // GET request on /api/extensions/:id diff --git a/api/http/handler/extensions/extension_list.go b/api/http/handler/extensions/extension_list.go index 68d26a7e7..ed7325c25 100644 --- a/api/http/handler/extensions/extension_list.go +++ b/api/http/handler/extensions/extension_list.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // GET request on /api/extensions?store= diff --git a/api/http/handler/extensions/extension_update.go b/api/http/handler/extensions/extension_update.go index 4e80ea1bc..b51bf93ba 100644 --- a/api/http/handler/extensions/extension_update.go +++ b/api/http/handler/extensions/extension_update.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type extensionUpdatePayload struct { diff --git a/api/http/handler/extensions/handler.go b/api/http/handler/extensions/handler.go index bba32f389..eb3d74ad1 100644 --- a/api/http/handler/extensions/handler.go +++ b/api/http/handler/extensions/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle extension operations. diff --git a/api/http/handler/handler.go b/api/http/handler/handler.go index 9cb3059df..85f41d0be 100644 --- a/api/http/handler/handler.go +++ b/api/http/handler/handler.go @@ -4,28 +4,28 @@ import ( "net/http" "strings" - "github.com/portainer/portainer/http/handler/auth" - "github.com/portainer/portainer/http/handler/dockerhub" - "github.com/portainer/portainer/http/handler/endpointgroups" - "github.com/portainer/portainer/http/handler/endpointproxy" - "github.com/portainer/portainer/http/handler/endpoints" - "github.com/portainer/portainer/http/handler/extensions" - "github.com/portainer/portainer/http/handler/file" - "github.com/portainer/portainer/http/handler/motd" - "github.com/portainer/portainer/http/handler/registries" - "github.com/portainer/portainer/http/handler/resourcecontrols" - "github.com/portainer/portainer/http/handler/schedules" - "github.com/portainer/portainer/http/handler/settings" - "github.com/portainer/portainer/http/handler/stacks" - "github.com/portainer/portainer/http/handler/status" - "github.com/portainer/portainer/http/handler/tags" - "github.com/portainer/portainer/http/handler/teammemberships" - "github.com/portainer/portainer/http/handler/teams" - "github.com/portainer/portainer/http/handler/templates" - "github.com/portainer/portainer/http/handler/upload" - "github.com/portainer/portainer/http/handler/users" - "github.com/portainer/portainer/http/handler/webhooks" - "github.com/portainer/portainer/http/handler/websocket" + "github.com/portainer/portainer/api/http/handler/auth" + "github.com/portainer/portainer/api/http/handler/dockerhub" + "github.com/portainer/portainer/api/http/handler/endpointgroups" + "github.com/portainer/portainer/api/http/handler/endpointproxy" + "github.com/portainer/portainer/api/http/handler/endpoints" + "github.com/portainer/portainer/api/http/handler/extensions" + "github.com/portainer/portainer/api/http/handler/file" + "github.com/portainer/portainer/api/http/handler/motd" + "github.com/portainer/portainer/api/http/handler/registries" + "github.com/portainer/portainer/api/http/handler/resourcecontrols" + "github.com/portainer/portainer/api/http/handler/schedules" + "github.com/portainer/portainer/api/http/handler/settings" + "github.com/portainer/portainer/api/http/handler/stacks" + "github.com/portainer/portainer/api/http/handler/status" + "github.com/portainer/portainer/api/http/handler/tags" + "github.com/portainer/portainer/api/http/handler/teammemberships" + "github.com/portainer/portainer/api/http/handler/teams" + "github.com/portainer/portainer/api/http/handler/templates" + "github.com/portainer/portainer/api/http/handler/upload" + "github.com/portainer/portainer/api/http/handler/users" + "github.com/portainer/portainer/api/http/handler/webhooks" + "github.com/portainer/portainer/api/http/handler/websocket" ) // Handler is a collection of all the service handlers. diff --git a/api/http/handler/motd/handler.go b/api/http/handler/motd/handler.go index 429731aa4..26f5b6a91 100644 --- a/api/http/handler/motd/handler.go +++ b/api/http/handler/motd/handler.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle MOTD operations. diff --git a/api/http/handler/motd/motd.go b/api/http/handler/motd/motd.go index 9d4f18004..253be31cc 100644 --- a/api/http/handler/motd/motd.go +++ b/api/http/handler/motd/motd.go @@ -4,9 +4,9 @@ import ( "net/http" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/crypto" - "github.com/portainer/portainer/http/client" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/crypto" + "github.com/portainer/portainer/api/http/client" ) type motdResponse struct { diff --git a/api/http/handler/registries/handler.go b/api/http/handler/registries/handler.go index 26edebd15..e38f4e4f4 100644 --- a/api/http/handler/registries/handler.go +++ b/api/http/handler/registries/handler.go @@ -5,9 +5,9 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) func hideFields(registry *portainer.Registry) { diff --git a/api/http/handler/registries/proxy.go b/api/http/handler/registries/proxy.go index 844dc7e79..d54520508 100644 --- a/api/http/handler/registries/proxy.go +++ b/api/http/handler/registries/proxy.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // request on /api/registries/:id/v2 diff --git a/api/http/handler/registries/registry_configure.go b/api/http/handler/registries/registry_configure.go index 0f5569141..c967b6996 100644 --- a/api/http/handler/registries/registry_configure.go +++ b/api/http/handler/registries/registry_configure.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type registryConfigurePayload struct { diff --git a/api/http/handler/registries/registry_create.go b/api/http/handler/registries/registry_create.go index 082f61352..ab412b937 100644 --- a/api/http/handler/registries/registry_create.go +++ b/api/http/handler/registries/registry_create.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type registryCreatePayload struct { diff --git a/api/http/handler/registries/registry_delete.go b/api/http/handler/registries/registry_delete.go index ac463af5f..ebb833ab4 100644 --- a/api/http/handler/registries/registry_delete.go +++ b/api/http/handler/registries/registry_delete.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/registries/:id diff --git a/api/http/handler/registries/registry_inspect.go b/api/http/handler/registries/registry_inspect.go index 1dd9a3ffb..d40ef693a 100644 --- a/api/http/handler/registries/registry_inspect.go +++ b/api/http/handler/registries/registry_inspect.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // GET request on /api/registries/:id diff --git a/api/http/handler/registries/registry_list.go b/api/http/handler/registries/registry_list.go index 7f75427cc..b78763375 100644 --- a/api/http/handler/registries/registry_list.go +++ b/api/http/handler/registries/registry_list.go @@ -5,7 +5,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/registries diff --git a/api/http/handler/registries/registry_update.go b/api/http/handler/registries/registry_update.go index cd3a7ae67..17f2304fd 100644 --- a/api/http/handler/registries/registry_update.go +++ b/api/http/handler/registries/registry_update.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type registryUpdatePayload struct { diff --git a/api/http/handler/registries/registry_update_access.go b/api/http/handler/registries/registry_update_access.go index 77f6fe08e..4d8925f19 100644 --- a/api/http/handler/registries/registry_update_access.go +++ b/api/http/handler/registries/registry_update_access.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type registryUpdateAccessPayload struct { diff --git a/api/http/handler/resourcecontrols/handler.go b/api/http/handler/resourcecontrols/handler.go index 60757ef28..d187ba6c8 100644 --- a/api/http/handler/resourcecontrols/handler.go +++ b/api/http/handler/resourcecontrols/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle resource control operations. diff --git a/api/http/handler/resourcecontrols/resourcecontrol_create.go b/api/http/handler/resourcecontrols/resourcecontrol_create.go index 97c3d5ef1..ad954805d 100644 --- a/api/http/handler/resourcecontrols/resourcecontrol_create.go +++ b/api/http/handler/resourcecontrols/resourcecontrol_create.go @@ -7,8 +7,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) type resourceControlCreatePayload struct { diff --git a/api/http/handler/resourcecontrols/resourcecontrol_delete.go b/api/http/handler/resourcecontrols/resourcecontrol_delete.go index 04ba8d5d4..1d1ea8ddf 100644 --- a/api/http/handler/resourcecontrols/resourcecontrol_delete.go +++ b/api/http/handler/resourcecontrols/resourcecontrol_delete.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // DELETE request on /api/resource_controls/:id diff --git a/api/http/handler/resourcecontrols/resourcecontrol_update.go b/api/http/handler/resourcecontrols/resourcecontrol_update.go index c46247c5d..360e704c9 100644 --- a/api/http/handler/resourcecontrols/resourcecontrol_update.go +++ b/api/http/handler/resourcecontrols/resourcecontrol_update.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) type resourceControlUpdatePayload struct { diff --git a/api/http/handler/schedules/handler.go b/api/http/handler/schedules/handler.go index c2c091209..5e5d0f46e 100644 --- a/api/http/handler/schedules/handler.go +++ b/api/http/handler/schedules/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle schedule operations. diff --git a/api/http/handler/schedules/schedule_create.go b/api/http/handler/schedules/schedule_create.go index 5c0ecbdbc..f4302bd4b 100644 --- a/api/http/handler/schedules/schedule_create.go +++ b/api/http/handler/schedules/schedule_create.go @@ -10,8 +10,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/cron" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/cron" ) type scheduleCreateFromFilePayload struct { diff --git a/api/http/handler/schedules/schedule_delete.go b/api/http/handler/schedules/schedule_delete.go index 67a02010a..a2ef81393 100644 --- a/api/http/handler/schedules/schedule_delete.go +++ b/api/http/handler/schedules/schedule_delete.go @@ -8,7 +8,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) func (handler *Handler) scheduleDelete(w http.ResponseWriter, r *http.Request) *httperror.HandlerError { diff --git a/api/http/handler/schedules/schedule_file.go b/api/http/handler/schedules/schedule_file.go index f24e10867..c10b698dd 100644 --- a/api/http/handler/schedules/schedule_file.go +++ b/api/http/handler/schedules/schedule_file.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type scheduleFileResponse struct { diff --git a/api/http/handler/schedules/schedule_inspect.go b/api/http/handler/schedules/schedule_inspect.go index bcd74b4b9..594c29b1a 100644 --- a/api/http/handler/schedules/schedule_inspect.go +++ b/api/http/handler/schedules/schedule_inspect.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" diff --git a/api/http/handler/schedules/schedule_list.go b/api/http/handler/schedules/schedule_list.go index f67eee452..55662dc0e 100644 --- a/api/http/handler/schedules/schedule_list.go +++ b/api/http/handler/schedules/schedule_list.go @@ -5,7 +5,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // GET request on /api/schedules diff --git a/api/http/handler/schedules/schedule_tasks.go b/api/http/handler/schedules/schedule_tasks.go index 0cbf24372..1c2810e45 100644 --- a/api/http/handler/schedules/schedule_tasks.go +++ b/api/http/handler/schedules/schedule_tasks.go @@ -9,7 +9,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type taskContainer struct { diff --git a/api/http/handler/schedules/schedule_update.go b/api/http/handler/schedules/schedule_update.go index 0edfd0dde..29a6dccbe 100644 --- a/api/http/handler/schedules/schedule_update.go +++ b/api/http/handler/schedules/schedule_update.go @@ -9,8 +9,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/cron" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/cron" ) type scheduleUpdatePayload struct { diff --git a/api/http/handler/settings/handler.go b/api/http/handler/settings/handler.go index a9033c701..34f467d5a 100644 --- a/api/http/handler/settings/handler.go +++ b/api/http/handler/settings/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) func hideFields(settings *portainer.Settings) { diff --git a/api/http/handler/settings/settings_ldap_check.go b/api/http/handler/settings/settings_ldap_check.go index a8466e285..863612fd4 100644 --- a/api/http/handler/settings/settings_ldap_check.go +++ b/api/http/handler/settings/settings_ldap_check.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/filesystem" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/filesystem" ) type settingsLDAPCheckPayload struct { diff --git a/api/http/handler/settings/settings_public.go b/api/http/handler/settings/settings_public.go index cc1e07854..38eb8d4e3 100644 --- a/api/http/handler/settings/settings_public.go +++ b/api/http/handler/settings/settings_public.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type publicSettingsResponse struct { diff --git a/api/http/handler/settings/settings_update.go b/api/http/handler/settings/settings_update.go index 21b9daa99..cc9c901dc 100644 --- a/api/http/handler/settings/settings_update.go +++ b/api/http/handler/settings/settings_update.go @@ -7,8 +7,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/filesystem" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/filesystem" ) type settingsUpdatePayload struct { diff --git a/api/http/handler/stacks/create_compose_stack.go b/api/http/handler/stacks/create_compose_stack.go index a6a8ddcfd..66c9d91cb 100644 --- a/api/http/handler/stacks/create_compose_stack.go +++ b/api/http/handler/stacks/create_compose_stack.go @@ -9,9 +9,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/filesystem" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/filesystem" + "github.com/portainer/portainer/api/http/security" ) type composeStackFromFileContentPayload struct { diff --git a/api/http/handler/stacks/create_swarm_stack.go b/api/http/handler/stacks/create_swarm_stack.go index 017122026..0832111e0 100644 --- a/api/http/handler/stacks/create_swarm_stack.go +++ b/api/http/handler/stacks/create_swarm_stack.go @@ -9,9 +9,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/filesystem" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/filesystem" + "github.com/portainer/portainer/api/http/security" ) type swarmStackFromFileContentPayload struct { diff --git a/api/http/handler/stacks/handler.go b/api/http/handler/stacks/handler.go index 7f2fd4bc0..caf181bef 100644 --- a/api/http/handler/stacks/handler.go +++ b/api/http/handler/stacks/handler.go @@ -6,8 +6,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle stack operations. diff --git a/api/http/handler/stacks/stack_create.go b/api/http/handler/stacks/stack_create.go index 0fe7e07ad..977820ddd 100644 --- a/api/http/handler/stacks/stack_create.go +++ b/api/http/handler/stacks/stack_create.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) func (handler *Handler) cleanUp(stack *portainer.Stack, doCleanUp *bool) error { diff --git a/api/http/handler/stacks/stack_delete.go b/api/http/handler/stacks/stack_delete.go index 8f8fc25e8..a7174a8f5 100644 --- a/api/http/handler/stacks/stack_delete.go +++ b/api/http/handler/stacks/stack_delete.go @@ -7,9 +7,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) // DELETE request on /api/stacks/:id?external=&endpointId= diff --git a/api/http/handler/stacks/stack_file.go b/api/http/handler/stacks/stack_file.go index b0b247cef..776e3b3b0 100644 --- a/api/http/handler/stacks/stack_file.go +++ b/api/http/handler/stacks/stack_file.go @@ -7,9 +7,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) type stackFileResponse struct { diff --git a/api/http/handler/stacks/stack_inspect.go b/api/http/handler/stacks/stack_inspect.go index e5377f654..9ca2dc950 100644 --- a/api/http/handler/stacks/stack_inspect.go +++ b/api/http/handler/stacks/stack_inspect.go @@ -6,9 +6,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/stacks/:id diff --git a/api/http/handler/stacks/stack_list.go b/api/http/handler/stacks/stack_list.go index 337b204a7..aabd68eee 100644 --- a/api/http/handler/stacks/stack_list.go +++ b/api/http/handler/stacks/stack_list.go @@ -6,9 +6,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) type stackListOperationFilters struct { diff --git a/api/http/handler/stacks/stack_migrate.go b/api/http/handler/stacks/stack_migrate.go index 704394766..1a077f867 100644 --- a/api/http/handler/stacks/stack_migrate.go +++ b/api/http/handler/stacks/stack_migrate.go @@ -6,9 +6,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) type stackMigratePayload struct { diff --git a/api/http/handler/stacks/stack_update.go b/api/http/handler/stacks/stack_update.go index 03999a557..1d5c995cc 100644 --- a/api/http/handler/stacks/stack_update.go +++ b/api/http/handler/stacks/stack_update.go @@ -8,9 +8,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" ) type updateComposeStackPayload struct { diff --git a/api/http/handler/status/handler.go b/api/http/handler/status/handler.go index 4d26fcd3a..cb30c8479 100644 --- a/api/http/handler/status/handler.go +++ b/api/http/handler/status/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle status operations. diff --git a/api/http/handler/tags/handler.go b/api/http/handler/tags/handler.go index b38bd28f3..fe8d011c7 100644 --- a/api/http/handler/tags/handler.go +++ b/api/http/handler/tags/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle tag operations. diff --git a/api/http/handler/tags/tag_create.go b/api/http/handler/tags/tag_create.go index 50b9261ba..e639cd39b 100644 --- a/api/http/handler/tags/tag_create.go +++ b/api/http/handler/tags/tag_create.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type tagCreatePayload struct { diff --git a/api/http/handler/tags/tag_delete.go b/api/http/handler/tags/tag_delete.go index e74b5ef12..9c9e9d4e3 100644 --- a/api/http/handler/tags/tag_delete.go +++ b/api/http/handler/tags/tag_delete.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/tags/:id diff --git a/api/http/handler/teammemberships/handler.go b/api/http/handler/teammemberships/handler.go index 10cd63a83..d2d712f28 100644 --- a/api/http/handler/teammemberships/handler.go +++ b/api/http/handler/teammemberships/handler.go @@ -2,8 +2,8 @@ package teammemberships import ( httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" "net/http" diff --git a/api/http/handler/teammemberships/teammembership_create.go b/api/http/handler/teammemberships/teammembership_create.go index 37216df6a..0d8716de9 100644 --- a/api/http/handler/teammemberships/teammembership_create.go +++ b/api/http/handler/teammemberships/teammembership_create.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) type teamMembershipCreatePayload struct { diff --git a/api/http/handler/teammemberships/teammembership_delete.go b/api/http/handler/teammemberships/teammembership_delete.go index 846fb7892..dd8fe6d0b 100644 --- a/api/http/handler/teammemberships/teammembership_delete.go +++ b/api/http/handler/teammemberships/teammembership_delete.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // DELETE request on /api/team_memberships/:id diff --git a/api/http/handler/teammemberships/teammembership_list.go b/api/http/handler/teammemberships/teammembership_list.go index 4136053d6..bb0196458 100644 --- a/api/http/handler/teammemberships/teammembership_list.go +++ b/api/http/handler/teammemberships/teammembership_list.go @@ -5,8 +5,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/team_memberships diff --git a/api/http/handler/teammemberships/teammembership_update.go b/api/http/handler/teammemberships/teammembership_update.go index 0e400e975..84ab44323 100644 --- a/api/http/handler/teammemberships/teammembership_update.go +++ b/api/http/handler/teammemberships/teammembership_update.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) type teamMembershipUpdatePayload struct { diff --git a/api/http/handler/teams/handler.go b/api/http/handler/teams/handler.go index 946a071d7..c86d3a2e4 100644 --- a/api/http/handler/teams/handler.go +++ b/api/http/handler/teams/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle team operations. diff --git a/api/http/handler/teams/team_create.go b/api/http/handler/teams/team_create.go index 16b230ec4..3cfad7acb 100644 --- a/api/http/handler/teams/team_create.go +++ b/api/http/handler/teams/team_create.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type teamCreatePayload struct { diff --git a/api/http/handler/teams/team_delete.go b/api/http/handler/teams/team_delete.go index 00146d698..f38010725 100644 --- a/api/http/handler/teams/team_delete.go +++ b/api/http/handler/teams/team_delete.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/teams/:id diff --git a/api/http/handler/teams/team_inspect.go b/api/http/handler/teams/team_inspect.go index b8aa83da1..0eeb89e8f 100644 --- a/api/http/handler/teams/team_inspect.go +++ b/api/http/handler/teams/team_inspect.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/teams/:id diff --git a/api/http/handler/teams/team_list.go b/api/http/handler/teams/team_list.go index 4acc5eabb..da67b696b 100644 --- a/api/http/handler/teams/team_list.go +++ b/api/http/handler/teams/team_list.go @@ -5,7 +5,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/teams diff --git a/api/http/handler/teams/team_memberships.go b/api/http/handler/teams/team_memberships.go index 450458e35..e7c26fff6 100644 --- a/api/http/handler/teams/team_memberships.go +++ b/api/http/handler/teams/team_memberships.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/teams/:id/memberships diff --git a/api/http/handler/teams/team_update.go b/api/http/handler/teams/team_update.go index dea180b6a..740e4fc61 100644 --- a/api/http/handler/teams/team_update.go +++ b/api/http/handler/teams/team_update.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type teamUpdatePayload struct { diff --git a/api/http/handler/templates/handler.go b/api/http/handler/templates/handler.go index 660991d8d..7e14f2d37 100644 --- a/api/http/handler/templates/handler.go +++ b/api/http/handler/templates/handler.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) const ( diff --git a/api/http/handler/templates/template_create.go b/api/http/handler/templates/template_create.go index ef9c0c58f..6c4d21a25 100644 --- a/api/http/handler/templates/template_create.go +++ b/api/http/handler/templates/template_create.go @@ -7,8 +7,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/filesystem" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/filesystem" ) type templateCreatePayload struct { diff --git a/api/http/handler/templates/template_delete.go b/api/http/handler/templates/template_delete.go index f5793bb8c..cf82e7889 100644 --- a/api/http/handler/templates/template_delete.go +++ b/api/http/handler/templates/template_delete.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/templates/:id diff --git a/api/http/handler/templates/template_inspect.go b/api/http/handler/templates/template_inspect.go index 70b6ada02..bac836421 100644 --- a/api/http/handler/templates/template_inspect.go +++ b/api/http/handler/templates/template_inspect.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // GET request on /api/templates/:id diff --git a/api/http/handler/templates/template_list.go b/api/http/handler/templates/template_list.go index 7e802528f..41013c8ff 100644 --- a/api/http/handler/templates/template_list.go +++ b/api/http/handler/templates/template_list.go @@ -6,9 +6,9 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/client" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/client" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/templates diff --git a/api/http/handler/templates/template_update.go b/api/http/handler/templates/template_update.go index 123ea0f6a..fb0568aa3 100644 --- a/api/http/handler/templates/template_update.go +++ b/api/http/handler/templates/template_update.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type templateUpdatePayload struct { diff --git a/api/http/handler/upload/handler.go b/api/http/handler/upload/handler.go index b0068979b..757206a80 100644 --- a/api/http/handler/upload/handler.go +++ b/api/http/handler/upload/handler.go @@ -2,8 +2,8 @@ package upload import ( httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" "net/http" diff --git a/api/http/handler/upload/upload_tls.go b/api/http/handler/upload/upload_tls.go index 964a7d29b..383f21fac 100644 --- a/api/http/handler/upload/upload_tls.go +++ b/api/http/handler/upload/upload_tls.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // POST request on /api/upload/tls/{certificate:(?:ca|cert|key)}?folder= diff --git a/api/http/handler/users/admin_check.go b/api/http/handler/users/admin_check.go index 5fcd1d33d..0f53e6693 100644 --- a/api/http/handler/users/admin_check.go +++ b/api/http/handler/users/admin_check.go @@ -5,7 +5,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // GET request on /api/users/admin/check diff --git a/api/http/handler/users/admin_init.go b/api/http/handler/users/admin_init.go index fb2172686..d18fc3c3b 100644 --- a/api/http/handler/users/admin_init.go +++ b/api/http/handler/users/admin_init.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type adminInitPayload struct { diff --git a/api/http/handler/users/handler.go b/api/http/handler/users/handler.go index ae43ef521..ef20c6ccb 100644 --- a/api/http/handler/users/handler.go +++ b/api/http/handler/users/handler.go @@ -2,8 +2,8 @@ package users import ( httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" "net/http" diff --git a/api/http/handler/users/user_create.go b/api/http/handler/users/user_create.go index 7948ec2b6..5aead6b96 100644 --- a/api/http/handler/users/user_create.go +++ b/api/http/handler/users/user_create.go @@ -7,8 +7,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) type userCreatePayload struct { diff --git a/api/http/handler/users/user_delete.go b/api/http/handler/users/user_delete.go index 78f83fe57..c600e1943 100644 --- a/api/http/handler/users/user_delete.go +++ b/api/http/handler/users/user_delete.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // DELETE request on /api/users/:id diff --git a/api/http/handler/users/user_inspect.go b/api/http/handler/users/user_inspect.go index a2e185bdf..f0723bd49 100644 --- a/api/http/handler/users/user_inspect.go +++ b/api/http/handler/users/user_inspect.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // GET request on /api/users/:id diff --git a/api/http/handler/users/user_list.go b/api/http/handler/users/user_list.go index 9b46ff5eb..5792689a0 100644 --- a/api/http/handler/users/user_list.go +++ b/api/http/handler/users/user_list.go @@ -5,7 +5,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/users diff --git a/api/http/handler/users/user_memberships.go b/api/http/handler/users/user_memberships.go index 2ba837aec..090880e6b 100644 --- a/api/http/handler/users/user_memberships.go +++ b/api/http/handler/users/user_memberships.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // GET request on /api/users/:id/memberships diff --git a/api/http/handler/users/user_update.go b/api/http/handler/users/user_update.go index 4ae5e50ab..62ba24f46 100644 --- a/api/http/handler/users/user_update.go +++ b/api/http/handler/users/user_update.go @@ -6,8 +6,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) type userUpdatePayload struct { diff --git a/api/http/handler/users/user_update_password.go b/api/http/handler/users/user_update_password.go index e5a65c8e3..77ce99b49 100644 --- a/api/http/handler/users/user_update_password.go +++ b/api/http/handler/users/user_update_password.go @@ -7,8 +7,8 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) type userUpdatePasswordPayload struct { diff --git a/api/http/handler/webhooks/handler.go b/api/http/handler/webhooks/handler.go index d9b583535..2e342114e 100644 --- a/api/http/handler/webhooks/handler.go +++ b/api/http/handler/webhooks/handler.go @@ -5,9 +5,9 @@ import ( "github.com/gorilla/mux" httperror "github.com/portainer/libhttp/error" - portainer "github.com/portainer/portainer" - "github.com/portainer/portainer/docker" - "github.com/portainer/portainer/http/security" + portainer "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/docker" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle webhook operations. diff --git a/api/http/handler/webhooks/webhook_create.go b/api/http/handler/webhooks/webhook_create.go index 288435889..5a6867591 100644 --- a/api/http/handler/webhooks/webhook_create.go +++ b/api/http/handler/webhooks/webhook_create.go @@ -7,7 +7,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "github.com/satori/go.uuid" ) diff --git a/api/http/handler/webhooks/webhook_delete.go b/api/http/handler/webhooks/webhook_delete.go index 6df0e4156..ee36f822c 100644 --- a/api/http/handler/webhooks/webhook_delete.go +++ b/api/http/handler/webhooks/webhook_delete.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // DELETE request on /api/webhook/:serviceID diff --git a/api/http/handler/webhooks/webhook_execute.go b/api/http/handler/webhooks/webhook_execute.go index 9126942e7..31b359ff6 100644 --- a/api/http/handler/webhooks/webhook_execute.go +++ b/api/http/handler/webhooks/webhook_execute.go @@ -9,7 +9,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // Acts on a passed in token UUID to restart the docker service diff --git a/api/http/handler/webhooks/webhook_list.go b/api/http/handler/webhooks/webhook_list.go index 7ed0df213..a45051884 100644 --- a/api/http/handler/webhooks/webhook_list.go +++ b/api/http/handler/webhooks/webhook_list.go @@ -6,7 +6,7 @@ import ( httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type webhookListOperationFilters struct { diff --git a/api/http/handler/websocket/handler.go b/api/http/handler/websocket/handler.go index 3de1cbc60..14a197d84 100644 --- a/api/http/handler/websocket/handler.go +++ b/api/http/handler/websocket/handler.go @@ -4,8 +4,8 @@ import ( "github.com/gorilla/mux" "github.com/gorilla/websocket" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) // Handler is the HTTP handler used to handle websocket operations. diff --git a/api/http/handler/websocket/websocket_exec.go b/api/http/handler/websocket/websocket_exec.go index ba4a9d7e6..bc3cde00a 100644 --- a/api/http/handler/websocket/websocket_exec.go +++ b/api/http/handler/websocket/websocket_exec.go @@ -17,8 +17,8 @@ import ( "github.com/koding/websocketproxy" httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" - "github.com/portainer/portainer" - "github.com/portainer/portainer/crypto" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/crypto" ) type webSocketExecRequestParams struct { diff --git a/api/http/proxy/access_control.go b/api/http/proxy/access_control.go index e63dc6346..c84f67c04 100644 --- a/api/http/proxy/access_control.go +++ b/api/http/proxy/access_control.go @@ -1,7 +1,7 @@ package proxy import ( - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type ( diff --git a/api/http/proxy/azure_transport.go b/api/http/proxy/azure_transport.go index dccf451b5..f0752b925 100644 --- a/api/http/proxy/azure_transport.go +++ b/api/http/proxy/azure_transport.go @@ -6,8 +6,8 @@ import ( "sync" "time" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/client" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/client" ) type ( diff --git a/api/http/proxy/build.go b/api/http/proxy/build.go index aaa486f07..93f0d4a68 100644 --- a/api/http/proxy/build.go +++ b/api/http/proxy/build.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/portainer/portainer/archive" + "github.com/portainer/portainer/api/archive" ) type postDockerfileRequest struct { diff --git a/api/http/proxy/configs.go b/api/http/proxy/configs.go index fc05dd74c..e252a7cee 100644 --- a/api/http/proxy/configs.go +++ b/api/http/proxy/configs.go @@ -3,7 +3,7 @@ package proxy import ( "net/http" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/proxy/containers.go b/api/http/proxy/containers.go index 4e6c835ff..a605a3c5f 100644 --- a/api/http/proxy/containers.go +++ b/api/http/proxy/containers.go @@ -3,7 +3,7 @@ package proxy import ( "net/http" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/proxy/docker_transport.go b/api/http/proxy/docker_transport.go index 7521ee337..110b65f83 100644 --- a/api/http/proxy/docker_transport.go +++ b/api/http/proxy/docker_transport.go @@ -8,8 +8,8 @@ import ( "regexp" "strings" - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) var apiVersionRe = regexp.MustCompile(`(/v[0-9]\.[0-9]*)?`) diff --git a/api/http/proxy/factory.go b/api/http/proxy/factory.go index 90b5ad444..ee67ca5cf 100644 --- a/api/http/proxy/factory.go +++ b/api/http/proxy/factory.go @@ -6,8 +6,8 @@ import ( "net/http/httputil" "net/url" - "github.com/portainer/portainer" - "github.com/portainer/portainer/crypto" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/crypto" ) // AzureAPIBaseURL is the URL where Azure API requests will be proxied. diff --git a/api/http/proxy/manager.go b/api/http/proxy/manager.go index 7572ff658..328ad81ed 100644 --- a/api/http/proxy/manager.go +++ b/api/http/proxy/manager.go @@ -6,7 +6,7 @@ import ( "strconv" "github.com/orcaman/concurrent-map" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // TODO: contain code related to legacy extension management diff --git a/api/http/proxy/networks.go b/api/http/proxy/networks.go index a131ab2ab..63290e4d3 100644 --- a/api/http/proxy/networks.go +++ b/api/http/proxy/networks.go @@ -3,7 +3,7 @@ package proxy import ( "net/http" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/proxy/registry.go b/api/http/proxy/registry.go index 5edeb73b7..5f614f29d 100644 --- a/api/http/proxy/registry.go +++ b/api/http/proxy/registry.go @@ -1,8 +1,8 @@ package proxy import ( - "github.com/portainer/portainer" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/http/security" ) func createRegistryAuthenticationHeader(serverAddress string, accessContext *registryAccessContext) *registryAuthenticationHeader { diff --git a/api/http/proxy/response.go b/api/http/proxy/response.go index 3be65bbc6..a974d8f25 100644 --- a/api/http/proxy/response.go +++ b/api/http/proxy/response.go @@ -8,7 +8,7 @@ import ( "net/http" "strconv" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/proxy/secrets.go b/api/http/proxy/secrets.go index 9c4d8b093..a49418bbb 100644 --- a/api/http/proxy/secrets.go +++ b/api/http/proxy/secrets.go @@ -3,7 +3,7 @@ package proxy import ( "net/http" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/proxy/services.go b/api/http/proxy/services.go index b11208b58..d48895278 100644 --- a/api/http/proxy/services.go +++ b/api/http/proxy/services.go @@ -3,7 +3,7 @@ package proxy import ( "net/http" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/proxy/tasks.go b/api/http/proxy/tasks.go index d75ce54ec..e9d5bdd0a 100644 --- a/api/http/proxy/tasks.go +++ b/api/http/proxy/tasks.go @@ -3,7 +3,7 @@ package proxy import ( "net/http" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/proxy/volumes.go b/api/http/proxy/volumes.go index 82f1b5cf6..4ee885609 100644 --- a/api/http/proxy/volumes.go +++ b/api/http/proxy/volumes.go @@ -3,7 +3,7 @@ package proxy import ( "net/http" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) const ( diff --git a/api/http/security/authorization.go b/api/http/security/authorization.go index 4a0bac587..e1bb256ea 100644 --- a/api/http/security/authorization.go +++ b/api/http/security/authorization.go @@ -1,7 +1,7 @@ package security import ( - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // AuthorizedResourceControlDeletion ensure that the user can delete a resource control object. diff --git a/api/http/security/bouncer.go b/api/http/security/bouncer.go index fa88612a8..66397b916 100644 --- a/api/http/security/bouncer.go +++ b/api/http/security/bouncer.go @@ -2,7 +2,7 @@ package security import ( httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "net/http" "strings" diff --git a/api/http/security/context.go b/api/http/security/context.go index 4f6141768..58daaa9e3 100644 --- a/api/http/security/context.go +++ b/api/http/security/context.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) type ( diff --git a/api/http/security/filter.go b/api/http/security/filter.go index 4d44043b3..f8ca4f67e 100644 --- a/api/http/security/filter.go +++ b/api/http/security/filter.go @@ -1,6 +1,6 @@ package security -import "github.com/portainer/portainer" +import "github.com/portainer/portainer/api" // FilterUserTeams filters teams based on user role. // non-administrator users only have access to team they are member of. diff --git a/api/http/security/rate_limiter.go b/api/http/security/rate_limiter.go index 307329723..e8cc7ae5c 100644 --- a/api/http/security/rate_limiter.go +++ b/api/http/security/rate_limiter.go @@ -7,7 +7,7 @@ import ( "github.com/g07cha/defender" httperror "github.com/portainer/libhttp/error" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // RateLimiter represents an entity that manages request rate limiting diff --git a/api/http/server.go b/api/http/server.go index 7f3368f25..b2428a473 100644 --- a/api/http/server.go +++ b/api/http/server.go @@ -3,33 +3,33 @@ package http import ( "time" - "github.com/portainer/portainer" - "github.com/portainer/portainer/docker" - "github.com/portainer/portainer/http/handler" - "github.com/portainer/portainer/http/handler/auth" - "github.com/portainer/portainer/http/handler/dockerhub" - "github.com/portainer/portainer/http/handler/endpointgroups" - "github.com/portainer/portainer/http/handler/endpointproxy" - "github.com/portainer/portainer/http/handler/endpoints" - "github.com/portainer/portainer/http/handler/extensions" - "github.com/portainer/portainer/http/handler/file" - "github.com/portainer/portainer/http/handler/motd" - "github.com/portainer/portainer/http/handler/registries" - "github.com/portainer/portainer/http/handler/resourcecontrols" - "github.com/portainer/portainer/http/handler/schedules" - "github.com/portainer/portainer/http/handler/settings" - "github.com/portainer/portainer/http/handler/stacks" - "github.com/portainer/portainer/http/handler/status" - "github.com/portainer/portainer/http/handler/tags" - "github.com/portainer/portainer/http/handler/teammemberships" - "github.com/portainer/portainer/http/handler/teams" - "github.com/portainer/portainer/http/handler/templates" - "github.com/portainer/portainer/http/handler/upload" - "github.com/portainer/portainer/http/handler/users" - "github.com/portainer/portainer/http/handler/webhooks" - "github.com/portainer/portainer/http/handler/websocket" - "github.com/portainer/portainer/http/proxy" - "github.com/portainer/portainer/http/security" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/docker" + "github.com/portainer/portainer/api/http/handler" + "github.com/portainer/portainer/api/http/handler/auth" + "github.com/portainer/portainer/api/http/handler/dockerhub" + "github.com/portainer/portainer/api/http/handler/endpointgroups" + "github.com/portainer/portainer/api/http/handler/endpointproxy" + "github.com/portainer/portainer/api/http/handler/endpoints" + "github.com/portainer/portainer/api/http/handler/extensions" + "github.com/portainer/portainer/api/http/handler/file" + "github.com/portainer/portainer/api/http/handler/motd" + "github.com/portainer/portainer/api/http/handler/registries" + "github.com/portainer/portainer/api/http/handler/resourcecontrols" + "github.com/portainer/portainer/api/http/handler/schedules" + "github.com/portainer/portainer/api/http/handler/settings" + "github.com/portainer/portainer/api/http/handler/stacks" + "github.com/portainer/portainer/api/http/handler/status" + "github.com/portainer/portainer/api/http/handler/tags" + "github.com/portainer/portainer/api/http/handler/teammemberships" + "github.com/portainer/portainer/api/http/handler/teams" + "github.com/portainer/portainer/api/http/handler/templates" + "github.com/portainer/portainer/api/http/handler/upload" + "github.com/portainer/portainer/api/http/handler/users" + "github.com/portainer/portainer/api/http/handler/webhooks" + "github.com/portainer/portainer/api/http/handler/websocket" + "github.com/portainer/portainer/api/http/proxy" + "github.com/portainer/portainer/api/http/security" "net/http" "path/filepath" diff --git a/api/jwt/jwt.go b/api/jwt/jwt.go index 9d14be4bc..8880b8674 100644 --- a/api/jwt/jwt.go +++ b/api/jwt/jwt.go @@ -1,7 +1,7 @@ package jwt import ( - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" "fmt" "time" diff --git a/api/ldap/ldap.go b/api/ldap/ldap.go index 05c9d55d7..c86f75508 100644 --- a/api/ldap/ldap.go +++ b/api/ldap/ldap.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/portainer/portainer" - "github.com/portainer/portainer/crypto" + "github.com/portainer/portainer/api" + "github.com/portainer/portainer/api/crypto" "gopkg.in/ldap.v2" ) diff --git a/api/libcompose/compose_stack.go b/api/libcompose/compose_stack.go index 2759f01cf..bcd211a6b 100644 --- a/api/libcompose/compose_stack.go +++ b/api/libcompose/compose_stack.go @@ -12,7 +12,7 @@ import ( "github.com/portainer/libcompose/lookup" "github.com/portainer/libcompose/project" "github.com/portainer/libcompose/project/options" - "github.com/portainer/portainer" + "github.com/portainer/portainer/api" ) // ComposeStackManager represents a service for managing compose stacks. diff --git a/build/build_binary_devops.ps1 b/build/build_binary_devops.ps1 index 3ded6f4b3..2160b2c47 100755 --- a/build/build_binary_devops.ps1 +++ b/build/build_binary_devops.ps1 @@ -11,10 +11,9 @@ $go_path = "$($(Get-ITEM -Path env:AGENT_HOMEDIRECTORY).Value)\go" Set-Item env:GOPATH "$go_path" New-Item -Name dist -Path "." -ItemType Directory | Out-Null -New-Item -Name portainer -Path "$go_path\src\github.com\" -ItemType Directory | Out-Null +New-Item -Name portainer -Path "$go_path\src\github.com\portainer" -ItemType Directory | Out-Null -Copy-Item -Path "api" -Destination "$go_path\src\github.com\portainer" -Recurse -Force -ErrorAction:SilentlyContinue -Rename-Item -Path "$go_path\src\github.com\portainer\api" -NewName "portainer" -ErrorAction:SilentlyContinue +Copy-Item -Path "api" -Destination "$go_path\src\github.com\portainer\portainer\api" -Recurse -Force -ErrorAction:SilentlyContinue Set-Location -Path "api\cmd\portainer" diff --git a/build/build_binary_devops.sh b/build/build_binary_devops.sh index ccabcc6d7..f209e472c 100755 --- a/build/build_binary_devops.sh +++ b/build/build_binary_devops.sh @@ -1,11 +1,11 @@ -export GOPATH="$BUILD_SOURCESDIRECTORY/api" +export GOPATH="/tmp/go" binary="portainer" mkdir -p dist -mkdir -p api/src/github.com/portainer/ +mkdir -p ${GOPATH}/src/github.com/portainer/portainer -cp -R api/ api/src/github.com/portainer/portainer/ +cp -R api ${GOPATH}/src/github.com/portainer/portainer/api cd 'api/cmd/portainer'