From 5b3af827e197685b4222afa67f955b7b7fad8b06 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 26 Oct 2023 09:02:50 +0800 Subject: [PATCH] chore: move common packages to internal --- api/resource/resource.go | 4 ++-- api/v1/auth.go | 2 +- api/v1/idp.go | 2 +- api/v1/jwt.go | 2 +- api/v1/memo.go | 4 ++-- api/v1/memo_organizer.go | 2 +- api/v1/memo_relation.go | 2 +- api/v1/resource.go | 4 ++-- api/v1/rss.go | 2 +- api/v1/storage.go | 2 +- api/v1/system.go | 2 +- api/v1/user.go | 2 +- api/v2/acl.go | 2 +- api/v2/resource_service.go | 2 +- cmd/memos.go | 2 +- cmd/setup.go | 2 +- {common => internal}/log/logger.go | 0 {common => internal}/util/util.go | 0 {common => internal}/util/util_test.go | 0 plugin/telegram/attachment.go | 2 +- plugin/telegram/bot.go | 2 +- server/embed_frontend.go | 2 +- server/server.go | 2 +- server/service/backup/backup.go | 2 +- store/db/mysql/memo.go | 2 +- store/db/mysql/mysql.go | 2 +- store/db/sqlite/memo.go | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) rename {common => internal}/log/logger.go (100%) rename {common => internal}/util/util.go (100%) rename {common => internal}/util/util_test.go (100%) diff --git a/api/resource/resource.go b/api/resource/resource.go index 4088d39c..892ea7a7 100644 --- a/api/resource/resource.go +++ b/api/resource/resource.go @@ -17,8 +17,8 @@ import ( "github.com/pkg/errors" "go.uber.org/zap" - "github.com/usememos/memos/common/log" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/log" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/server/profile" "github.com/usememos/memos/store" ) diff --git a/api/v1/auth.go b/api/v1/auth.go index a2116e53..389d1a72 100644 --- a/api/v1/auth.go +++ b/api/v1/auth.go @@ -14,7 +14,7 @@ import ( "golang.org/x/crypto/bcrypt" "github.com/usememos/memos/api/auth" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/plugin/idp" "github.com/usememos/memos/plugin/idp/oauth2" storepb "github.com/usememos/memos/proto/gen/store" diff --git a/api/v1/idp.go b/api/v1/idp.go index 2bc7e912..5c9272f7 100644 --- a/api/v1/idp.go +++ b/api/v1/idp.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo/v4" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/store" ) diff --git a/api/v1/jwt.go b/api/v1/jwt.go index a684e528..68a8893e 100644 --- a/api/v1/jwt.go +++ b/api/v1/jwt.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" "github.com/usememos/memos/api/auth" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) diff --git a/api/v1/memo.go b/api/v1/memo.go index 9a0eb1f2..3fbc7663 100644 --- a/api/v1/memo.go +++ b/api/v1/memo.go @@ -12,8 +12,8 @@ import ( "github.com/pkg/errors" "go.uber.org/zap" - "github.com/usememos/memos/common/log" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/log" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/server/service/metric" "github.com/usememos/memos/store" ) diff --git a/api/v1/memo_organizer.go b/api/v1/memo_organizer.go index e55f048a..2a125530 100644 --- a/api/v1/memo_organizer.go +++ b/api/v1/memo_organizer.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo/v4" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/store" ) diff --git a/api/v1/memo_relation.go b/api/v1/memo_relation.go index d3c6ecad..a2d80bbb 100644 --- a/api/v1/memo_relation.go +++ b/api/v1/memo_relation.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo/v4" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/store" ) diff --git a/api/v1/resource.go b/api/v1/resource.go index dd2b2b64..63825866 100644 --- a/api/v1/resource.go +++ b/api/v1/resource.go @@ -18,8 +18,8 @@ import ( "github.com/pkg/errors" "go.uber.org/zap" - "github.com/usememos/memos/common/log" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/log" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/plugin/storage/s3" "github.com/usememos/memos/store" ) diff --git a/api/v1/rss.go b/api/v1/rss.go index 6ecd330b..8d8da824 100644 --- a/api/v1/rss.go +++ b/api/v1/rss.go @@ -15,7 +15,7 @@ import ( "github.com/pkg/errors" "github.com/yuin/goldmark" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/store" ) diff --git a/api/v1/storage.go b/api/v1/storage.go index 8301eae3..4479a1d0 100644 --- a/api/v1/storage.go +++ b/api/v1/storage.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo/v4" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/store" ) diff --git a/api/v1/system.go b/api/v1/system.go index 381b988c..109e7f31 100644 --- a/api/v1/system.go +++ b/api/v1/system.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo/v4" "go.uber.org/zap" - "github.com/usememos/memos/common/log" + "github.com/usememos/memos/internal/log" "github.com/usememos/memos/server/profile" "github.com/usememos/memos/store" ) diff --git a/api/v1/user.go b/api/v1/user.go index 17d31437..268d6c48 100644 --- a/api/v1/user.go +++ b/api/v1/user.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" "golang.org/x/crypto/bcrypt" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/server/service/metric" "github.com/usememos/memos/store" ) diff --git a/api/v2/acl.go b/api/v2/acl.go index 854af433..cb3f1405 100644 --- a/api/v2/acl.go +++ b/api/v2/acl.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc/status" "github.com/usememos/memos/api/auth" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" storepb "github.com/usememos/memos/proto/gen/store" "github.com/usememos/memos/store" ) diff --git a/api/v2/resource_service.go b/api/v2/resource_service.go index 0fef644c..121832a4 100644 --- a/api/v2/resource_service.go +++ b/api/v2/resource_service.go @@ -12,7 +12,7 @@ import ( "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" - "github.com/usememos/memos/common/log" + "github.com/usememos/memos/internal/log" apiv2pb "github.com/usememos/memos/proto/gen/api/v2" "github.com/usememos/memos/server/profile" "github.com/usememos/memos/store" diff --git a/cmd/memos.go b/cmd/memos.go index f972415c..388688dc 100644 --- a/cmd/memos.go +++ b/cmd/memos.go @@ -12,7 +12,7 @@ import ( "github.com/spf13/viper" "go.uber.org/zap" - "github.com/usememos/memos/common/log" + "github.com/usememos/memos/internal/log" "github.com/usememos/memos/server" _profile "github.com/usememos/memos/server/profile" "github.com/usememos/memos/server/service/metric" diff --git a/cmd/setup.go b/cmd/setup.go index fda4572d..3683b46c 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/cobra" "golang.org/x/crypto/bcrypt" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/store" "github.com/usememos/memos/store/db/sqlite" ) diff --git a/common/log/logger.go b/internal/log/logger.go similarity index 100% rename from common/log/logger.go rename to internal/log/logger.go diff --git a/common/util/util.go b/internal/util/util.go similarity index 100% rename from common/util/util.go rename to internal/util/util.go diff --git a/common/util/util_test.go b/internal/util/util_test.go similarity index 100% rename from common/util/util_test.go rename to internal/util/util_test.go diff --git a/plugin/telegram/attachment.go b/plugin/telegram/attachment.go index d5ec9c2b..e252f3f0 100644 --- a/plugin/telegram/attachment.go +++ b/plugin/telegram/attachment.go @@ -5,7 +5,7 @@ import ( "go.uber.org/zap" - "github.com/usememos/memos/common/log" + "github.com/usememos/memos/internal/log" ) type Attachment struct { diff --git a/plugin/telegram/bot.go b/plugin/telegram/bot.go index 43349b9a..aa08f961 100644 --- a/plugin/telegram/bot.go +++ b/plugin/telegram/bot.go @@ -9,7 +9,7 @@ import ( "go.uber.org/zap" - "github.com/usememos/memos/common/log" + "github.com/usememos/memos/internal/log" ) type Handler interface { diff --git a/server/embed_frontend.go b/server/embed_frontend.go index 73e45536..497e5216 100644 --- a/server/embed_frontend.go +++ b/server/embed_frontend.go @@ -8,7 +8,7 @@ import ( "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" ) //go:embed dist diff --git a/server/server.go b/server/server.go index fc2aff1e..837a120f 100644 --- a/server/server.go +++ b/server/server.go @@ -18,7 +18,7 @@ import ( apiv1 "github.com/usememos/memos/api/v1" apiv2 "github.com/usememos/memos/api/v2" - "github.com/usememos/memos/common/log" + "github.com/usememos/memos/internal/log" "github.com/usememos/memos/plugin/telegram" "github.com/usememos/memos/server/integration" "github.com/usememos/memos/server/profile" diff --git a/server/service/backup/backup.go b/server/service/backup/backup.go index 9f073916..4747ab28 100644 --- a/server/service/backup/backup.go +++ b/server/service/backup/backup.go @@ -9,7 +9,7 @@ import ( "go.uber.org/zap" apiv1 "github.com/usememos/memos/api/v1" - "github.com/usememos/memos/common/log" + "github.com/usememos/memos/internal/log" "github.com/usememos/memos/store" ) diff --git a/store/db/mysql/memo.go b/store/db/mysql/memo.go index f387d64f..0aeb2085 100644 --- a/store/db/mysql/memo.go +++ b/store/db/mysql/memo.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/store" ) diff --git a/store/db/mysql/mysql.go b/store/db/mysql/mysql.go index 31545d95..fa9c0691 100644 --- a/store/db/mysql/mysql.go +++ b/store/db/mysql/mysql.go @@ -8,7 +8,7 @@ import ( "github.com/go-sql-driver/mysql" "github.com/pkg/errors" - "github.com/usememos/memos/common/log" + "github.com/usememos/memos/internal/log" "github.com/usememos/memos/server/profile" "github.com/usememos/memos/store" ) diff --git a/store/db/sqlite/memo.go b/store/db/sqlite/memo.go index acfc1b86..9a729e5f 100644 --- a/store/db/sqlite/memo.go +++ b/store/db/sqlite/memo.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" - "github.com/usememos/memos/common/util" + "github.com/usememos/memos/internal/util" "github.com/usememos/memos/store" )