diff --git a/src/chartserver/reverse_proxy.go b/src/chartserver/reverse_proxy.go index 30da495f2..ca4cc7a47 100644 --- a/src/chartserver/reverse_proxy.go +++ b/src/chartserver/reverse_proxy.go @@ -15,7 +15,7 @@ import ( "github.com/goharbor/harbor/src/common" hlog "github.com/goharbor/harbor/src/common/utils/log" - n_event "github.com/goharbor/harbor/src/core/notifier/event" + n_event "github.com/goharbor/harbor/src/pkg/notifier/event" "github.com/goharbor/harbor/src/replication" rep_event "github.com/goharbor/harbor/src/replication/event" "github.com/justinas/alice" diff --git a/src/core/api/chart_repository.go b/src/core/api/chart_repository.go index d857629a9..e8e1b1b1e 100755 --- a/src/core/api/chart_repository.go +++ b/src/core/api/chart_repository.go @@ -22,7 +22,7 @@ import ( "github.com/goharbor/harbor/src/core/config" "github.com/goharbor/harbor/src/core/label" "github.com/goharbor/harbor/src/core/middlewares" - n_event "github.com/goharbor/harbor/src/core/notifier/event" + n_event "github.com/goharbor/harbor/src/pkg/notifier/event" rep_event "github.com/goharbor/harbor/src/replication/event" "github.com/goharbor/harbor/src/replication/model" ) diff --git a/src/core/api/repository.go b/src/core/api/repository.go index 8a6a32a1c..e687f5238 100755 --- a/src/core/api/repository.go +++ b/src/core/api/repository.go @@ -37,11 +37,11 @@ import ( "github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/common/utils/registry" "github.com/goharbor/harbor/src/core/config" - notifierEvt "github.com/goharbor/harbor/src/core/notifier/event" coreutils "github.com/goharbor/harbor/src/core/utils" "github.com/goharbor/harbor/src/jobservice/logger" "github.com/goharbor/harbor/src/pkg/art" "github.com/goharbor/harbor/src/pkg/immutabletag/match/rule" + notifierEvt "github.com/goharbor/harbor/src/pkg/notifier/event" v1 "github.com/goharbor/harbor/src/pkg/scan/rest/v1" "github.com/goharbor/harbor/src/pkg/signature/notary" notarymodel "github.com/goharbor/harbor/src/pkg/signature/notary/model" diff --git a/src/core/main.go b/src/core/main.go index 1cda4d598..93cc7d7bb 100755 --- a/src/core/main.go +++ b/src/core/main.go @@ -43,9 +43,9 @@ import ( "github.com/goharbor/harbor/src/core/config" "github.com/goharbor/harbor/src/core/filter" "github.com/goharbor/harbor/src/core/middlewares" - _ "github.com/goharbor/harbor/src/core/notifier/topic" "github.com/goharbor/harbor/src/core/service/token" "github.com/goharbor/harbor/src/pkg/notification" + _ "github.com/goharbor/harbor/src/pkg/notifier/topic" "github.com/goharbor/harbor/src/pkg/scan" "github.com/goharbor/harbor/src/pkg/scan/dao/scanner" "github.com/goharbor/harbor/src/pkg/scan/event" diff --git a/src/core/middlewares/util/util.go b/src/core/middlewares/util/util.go index f90f21f4f..52aaec944 100644 --- a/src/core/middlewares/util/util.go +++ b/src/core/middlewares/util/util.go @@ -40,8 +40,8 @@ import ( "github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/core/config" "github.com/goharbor/harbor/src/core/filter" - notifierEvt "github.com/goharbor/harbor/src/core/notifier/event" "github.com/goharbor/harbor/src/core/promgr" + notifierEvt "github.com/goharbor/harbor/src/pkg/notifier/event" "github.com/goharbor/harbor/src/pkg/scan/vuln" "github.com/goharbor/harbor/src/pkg/scan/whitelist" digest "github.com/opencontainers/go-digest" diff --git a/src/core/service/notifications/jobs/handler.go b/src/core/service/notifications/jobs/handler.go index 2be15f08a..a045ef873 100755 --- a/src/core/service/notifications/jobs/handler.go +++ b/src/core/service/notifications/jobs/handler.go @@ -24,9 +24,9 @@ import ( "github.com/goharbor/harbor/src/common/job" "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/utils/log" - "github.com/goharbor/harbor/src/core/notifier/event" jjob "github.com/goharbor/harbor/src/jobservice/job" "github.com/goharbor/harbor/src/pkg/notification" + "github.com/goharbor/harbor/src/pkg/notifier/event" "github.com/goharbor/harbor/src/pkg/retention" sc "github.com/goharbor/harbor/src/pkg/scan" "github.com/goharbor/harbor/src/replication" diff --git a/src/core/service/notifications/registry/handler.go b/src/core/service/notifications/registry/handler.go index a9f0e6087..a3cca4b3a 100755 --- a/src/core/service/notifications/registry/handler.go +++ b/src/core/service/notifications/registry/handler.go @@ -30,8 +30,8 @@ import ( "github.com/goharbor/harbor/src/common/utils" "github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/core/config" - notifierEvt "github.com/goharbor/harbor/src/core/notifier/event" coreutils "github.com/goharbor/harbor/src/core/utils" + notifierEvt "github.com/goharbor/harbor/src/pkg/notifier/event" v1 "github.com/goharbor/harbor/src/pkg/scan/rest/v1" "github.com/goharbor/harbor/src/replication" "github.com/goharbor/harbor/src/replication/adapter" diff --git a/src/pkg/notification/hook/hook.go b/src/pkg/notification/hook/hook.go index 8524a0e0e..0f9d6e1e4 100755 --- a/src/pkg/notification/hook/hook.go +++ b/src/pkg/notification/hook/hook.go @@ -10,10 +10,10 @@ import ( cModels "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/core/utils" "github.com/goharbor/harbor/src/pkg/notification/job" "github.com/goharbor/harbor/src/pkg/notification/job/manager" + "github.com/goharbor/harbor/src/pkg/notifier/model" ) // Manager send hook diff --git a/src/pkg/notification/policy/manager/manager.go b/src/pkg/notification/policy/manager/manager.go index c4f6681c2..158b276e2 100755 --- a/src/pkg/notification/policy/manager/manager.go +++ b/src/pkg/notification/policy/manager/manager.go @@ -10,8 +10,8 @@ import ( commonhttp "github.com/goharbor/harbor/src/common/http" "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/utils/log" - notifierModel "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification/model" + notifierModel "github.com/goharbor/harbor/src/pkg/notifier/model" ) // DefaultManager ... diff --git a/src/core/notifier/event/event.go b/src/pkg/notifier/event/event.go similarity index 98% rename from src/core/notifier/event/event.go rename to src/pkg/notifier/event/event.go index a1df166b0..a40fe5438 100644 --- a/src/core/notifier/event/event.go +++ b/src/pkg/notifier/event/event.go @@ -5,9 +5,9 @@ import ( "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/utils/log" - "github.com/goharbor/harbor/src/core/notifier" - "github.com/goharbor/harbor/src/core/notifier/model" notifyModel "github.com/goharbor/harbor/src/pkg/notification/model" + "github.com/goharbor/harbor/src/pkg/notifier" + "github.com/goharbor/harbor/src/pkg/notifier/model" v1 "github.com/goharbor/harbor/src/pkg/scan/rest/v1" "github.com/pkg/errors" ) diff --git a/src/core/notifier/event/event_test.go b/src/pkg/notifier/event/event_test.go similarity index 98% rename from src/core/notifier/event/event_test.go rename to src/pkg/notifier/event/event_test.go index 21e0d8d23..d9b19f8e6 100644 --- a/src/core/notifier/event/event_test.go +++ b/src/pkg/notifier/event/event_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/goharbor/harbor/src/common/models" - notifierModel "github.com/goharbor/harbor/src/core/notifier/model" + notifierModel "github.com/goharbor/harbor/src/pkg/notifier/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/src/core/notifier/handler/notification/chart_handler.go b/src/pkg/notifier/handler/notification/chart_handler.go similarity index 98% rename from src/core/notifier/handler/notification/chart_handler.go rename to src/pkg/notifier/handler/notification/chart_handler.go index bb549c8a0..5cfc81565 100644 --- a/src/core/notifier/handler/notification/chart_handler.go +++ b/src/pkg/notifier/handler/notification/chart_handler.go @@ -6,8 +6,8 @@ import ( "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification" + "github.com/goharbor/harbor/src/pkg/notifier/model" ) // ChartPreprocessHandler preprocess chart event data diff --git a/src/core/notifier/handler/notification/chart_handler_test.go b/src/pkg/notifier/handler/notification/chart_handler_test.go similarity index 98% rename from src/core/notifier/handler/notification/chart_handler_test.go rename to src/pkg/notifier/handler/notification/chart_handler_test.go index 4bbfba8bd..633d4706b 100644 --- a/src/core/notifier/handler/notification/chart_handler_test.go +++ b/src/pkg/notifier/handler/notification/chart_handler_test.go @@ -5,9 +5,9 @@ import ( "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification" notificationModel "github.com/goharbor/harbor/src/pkg/notification/model" + "github.com/goharbor/harbor/src/pkg/notifier/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/src/core/notifier/handler/notification/http_handler.go b/src/pkg/notifier/handler/notification/http_handler.go similarity index 96% rename from src/core/notifier/handler/notification/http_handler.go rename to src/pkg/notifier/handler/notification/http_handler.go index 9795a7c2b..9ea5ba431 100755 --- a/src/core/notifier/handler/notification/http_handler.go +++ b/src/pkg/notifier/handler/notification/http_handler.go @@ -6,9 +6,9 @@ import ( "fmt" "github.com/goharbor/harbor/src/common/job/models" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/jobservice/job" "github.com/goharbor/harbor/src/pkg/notification" + "github.com/goharbor/harbor/src/pkg/notifier/model" ) // HTTPHandler preprocess http event data and start the hook processing diff --git a/src/core/notifier/handler/notification/http_handler_test.go b/src/pkg/notifier/handler/notification/http_handler_test.go similarity index 94% rename from src/core/notifier/handler/notification/http_handler_test.go rename to src/pkg/notifier/handler/notification/http_handler_test.go index c7d5ef3ae..0017315d7 100644 --- a/src/core/notifier/handler/notification/http_handler_test.go +++ b/src/pkg/notifier/handler/notification/http_handler_test.go @@ -8,9 +8,9 @@ import ( "github.com/goharbor/harbor/src/common/job/models" cModels "github.com/goharbor/harbor/src/common/models" - "github.com/goharbor/harbor/src/core/notifier/event" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification" + "github.com/goharbor/harbor/src/pkg/notifier/event" + "github.com/goharbor/harbor/src/pkg/notifier/model" "github.com/stretchr/testify/require" ) diff --git a/src/core/notifier/handler/notification/image_handler.go b/src/pkg/notifier/handler/notification/image_handler.go similarity index 100% rename from src/core/notifier/handler/notification/image_handler.go rename to src/pkg/notifier/handler/notification/image_handler.go diff --git a/src/core/notifier/handler/notification/image_handler_test.go b/src/pkg/notifier/handler/notification/image_handler_test.go similarity index 98% rename from src/core/notifier/handler/notification/image_handler_test.go rename to src/pkg/notifier/handler/notification/image_handler_test.go index ae1696b44..5256f7a29 100644 --- a/src/core/notifier/handler/notification/image_handler_test.go +++ b/src/pkg/notifier/handler/notification/image_handler_test.go @@ -9,9 +9,9 @@ import ( "github.com/goharbor/harbor/src/common/dao" "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification" notificationModel "github.com/goharbor/harbor/src/pkg/notification/model" + "github.com/goharbor/harbor/src/pkg/notifier/model" "github.com/pkg/errors" "github.com/stretchr/testify/require" ) diff --git a/src/core/notifier/handler/notification/processor.go b/src/pkg/notifier/handler/notification/processor.go similarity index 97% rename from src/core/notifier/handler/notification/processor.go rename to src/pkg/notifier/handler/notification/processor.go index 8e1aeb248..f2e165ff5 100644 --- a/src/core/notifier/handler/notification/processor.go +++ b/src/pkg/notifier/handler/notification/processor.go @@ -9,9 +9,9 @@ import ( "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier/event" - notifyModel "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification" + "github.com/goharbor/harbor/src/pkg/notifier/event" + notifyModel "github.com/goharbor/harbor/src/pkg/notifier/model" ) // getNameFromImgRepoFullName gets image name from repo full name with format `repoName/imageName` diff --git a/src/core/notifier/handler/notification/quota_handler.go b/src/pkg/notifier/handler/notification/quota_handler.go similarity index 95% rename from src/core/notifier/handler/notification/quota_handler.go rename to src/pkg/notifier/handler/notification/quota_handler.go index a9b1b2d18..16f84ca47 100644 --- a/src/core/notifier/handler/notification/quota_handler.go +++ b/src/pkg/notifier/handler/notification/quota_handler.go @@ -6,9 +6,9 @@ import ( "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier/model" - notifyModel "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification" + "github.com/goharbor/harbor/src/pkg/notifier/model" + notifyModel "github.com/goharbor/harbor/src/pkg/notifier/model" ) // QuotaPreprocessHandler preprocess image event data diff --git a/src/core/notifier/handler/notification/quota_handler_test.go b/src/pkg/notifier/handler/notification/quota_handler_test.go similarity index 95% rename from src/core/notifier/handler/notification/quota_handler_test.go rename to src/pkg/notifier/handler/notification/quota_handler_test.go index 3f0ede0f2..1b1492bdf 100644 --- a/src/core/notifier/handler/notification/quota_handler_test.go +++ b/src/pkg/notifier/handler/notification/quota_handler_test.go @@ -7,11 +7,11 @@ import ( "github.com/goharbor/harbor/src/common" "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification" nm "github.com/goharbor/harbor/src/pkg/notification/model" "github.com/goharbor/harbor/src/pkg/notification/policy" + "github.com/goharbor/harbor/src/pkg/notifier" + "github.com/goharbor/harbor/src/pkg/notifier/model" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/src/core/notifier/handler/notification/scan_image_handler.go b/src/pkg/notifier/handler/notification/scan_image_handler.go similarity index 98% rename from src/core/notifier/handler/notification/scan_image_handler.go rename to src/pkg/notifier/handler/notification/scan_image_handler.go index 3537535c7..e32250a99 100644 --- a/src/core/notifier/handler/notification/scan_image_handler.go +++ b/src/pkg/notifier/handler/notification/scan_image_handler.go @@ -7,8 +7,8 @@ import ( "github.com/goharbor/harbor/src/common/models" "github.com/goharbor/harbor/src/common/utils/log" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/notification" + "github.com/goharbor/harbor/src/pkg/notifier/model" v1 "github.com/goharbor/harbor/src/pkg/scan/rest/v1" "github.com/pkg/errors" ) diff --git a/src/core/notifier/handler/notification/scan_image_handler_test.go b/src/pkg/notifier/handler/notification/scan_image_handler_test.go similarity index 97% rename from src/core/notifier/handler/notification/scan_image_handler_test.go rename to src/pkg/notifier/handler/notification/scan_image_handler_test.go index fde7c725e..c2d2a8f45 100644 --- a/src/core/notifier/handler/notification/scan_image_handler_test.go +++ b/src/pkg/notifier/handler/notification/scan_image_handler_test.go @@ -9,12 +9,12 @@ import ( sc "github.com/goharbor/harbor/src/api/scan" "github.com/goharbor/harbor/src/common" "github.com/goharbor/harbor/src/core/config" - "github.com/goharbor/harbor/src/core/notifier" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/jobservice/job" "github.com/goharbor/harbor/src/pkg/notification" nm "github.com/goharbor/harbor/src/pkg/notification/model" "github.com/goharbor/harbor/src/pkg/notification/policy" + "github.com/goharbor/harbor/src/pkg/notifier" + "github.com/goharbor/harbor/src/pkg/notifier/model" "github.com/goharbor/harbor/src/pkg/scan/dao/scan" "github.com/goharbor/harbor/src/pkg/scan/report" v1 "github.com/goharbor/harbor/src/pkg/scan/rest/v1" diff --git a/src/core/notifier/model/event.go b/src/pkg/notifier/model/event.go similarity index 100% rename from src/core/notifier/model/event.go rename to src/pkg/notifier/model/event.go diff --git a/src/core/notifier/model/topic.go b/src/pkg/notifier/model/topic.go similarity index 100% rename from src/core/notifier/model/topic.go rename to src/pkg/notifier/model/topic.go diff --git a/src/core/notifier/notification_handler.go b/src/pkg/notifier/notification_handler.go similarity index 100% rename from src/core/notifier/notification_handler.go rename to src/pkg/notifier/notification_handler.go diff --git a/src/core/notifier/notifier.go b/src/pkg/notifier/notifier.go similarity index 100% rename from src/core/notifier/notifier.go rename to src/pkg/notifier/notifier.go diff --git a/src/core/notifier/notifier_test.go b/src/pkg/notifier/notifier_test.go similarity index 100% rename from src/core/notifier/notifier_test.go rename to src/pkg/notifier/notifier_test.go diff --git a/src/core/notifier/topic/topics.go b/src/pkg/notifier/topic/topics.go similarity index 87% rename from src/core/notifier/topic/topics.go rename to src/pkg/notifier/topic/topics.go index f55ace5c5..c6635e4d8 100644 --- a/src/core/notifier/topic/topics.go +++ b/src/pkg/notifier/topic/topics.go @@ -2,9 +2,9 @@ package topic import ( "github.com/goharbor/harbor/src/common/utils/log" - "github.com/goharbor/harbor/src/core/notifier" - "github.com/goharbor/harbor/src/core/notifier/handler/notification" - "github.com/goharbor/harbor/src/core/notifier/model" + "github.com/goharbor/harbor/src/pkg/notifier" + "github.com/goharbor/harbor/src/pkg/notifier/handler/notification" + "github.com/goharbor/harbor/src/pkg/notifier/model" ) // Subscribe topics diff --git a/src/pkg/scan/event/init.go b/src/pkg/scan/event/init.go index 83deb9e84..c01c026fc 100644 --- a/src/pkg/scan/event/init.go +++ b/src/pkg/scan/event/init.go @@ -16,8 +16,8 @@ package event import ( "github.com/goharbor/harbor/src/common/utils/log" - "github.com/goharbor/harbor/src/core/notifier" - "github.com/goharbor/harbor/src/core/notifier/model" + "github.com/goharbor/harbor/src/pkg/notifier" + "github.com/goharbor/harbor/src/pkg/notifier/model" "github.com/pkg/errors" ) diff --git a/src/pkg/scan/event/notification.go b/src/pkg/scan/event/notification.go index 3db66d9a1..5bb762b47 100644 --- a/src/pkg/scan/event/notification.go +++ b/src/pkg/scan/event/notification.go @@ -17,9 +17,9 @@ package event import ( "github.com/goharbor/harbor/src/api/scan" "github.com/goharbor/harbor/src/common/utils/log" - "github.com/goharbor/harbor/src/core/notifier" - "github.com/goharbor/harbor/src/core/notifier/model" "github.com/goharbor/harbor/src/pkg/art" + "github.com/goharbor/harbor/src/pkg/notifier" + "github.com/goharbor/harbor/src/pkg/notifier/model" "github.com/goharbor/harbor/src/pkg/q" "github.com/pkg/errors" )