From aa5dd17d070a4a26b195db83a2f4a184123c21dc Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sun, 8 Sep 2024 21:34:36 +0200 Subject: [PATCH] move config and constant packages to internal --- internal/booking/models.go | 2 +- internal/booking/service.go | 2 +- {config => internal/config}/config.go | 0 {config => internal/config}/host.go | 0 {constant => internal/constant}/months.go | 0 {constant => internal/constant}/routes.go | 0 internal/pdf/service.go | 2 +- internal/server/auth.go | 2 +- internal/server/handle_auth.go | 2 +- internal/server/handle_bookings.go | 4 ++-- internal/server/handle_pdf.go | 2 +- internal/server/handle_reports.go | 4 ++-- internal/server/server.go | 2 +- internal/view/component/request_booking_form.templ | 2 +- internal/view/component/request_booking_form_templ.go | 2 +- internal/view/layout/public.templ | 2 +- internal/view/layout/public_templ.go | 2 +- main.go | 2 +- 18 files changed, 16 insertions(+), 16 deletions(-) rename {config => internal/config}/config.go (100%) rename {config => internal/config}/host.go (100%) rename {constant => internal/constant}/months.go (100%) rename {constant => internal/constant}/routes.go (100%) diff --git a/internal/booking/models.go b/internal/booking/models.go index bce7855..55b80c2 100644 --- a/internal/booking/models.go +++ b/internal/booking/models.go @@ -7,7 +7,7 @@ import ( "gorm.io/gorm" - "github.com/rjNemo/rentease/config" + "github.com/rjNemo/rentease/internal/config" ) type Booking struct { diff --git a/internal/booking/service.go b/internal/booking/service.go index c8a3e32..f4835e9 100644 --- a/internal/booking/service.go +++ b/internal/booking/service.go @@ -13,7 +13,7 @@ import ( "gorm.io/gorm" "gorm.io/gorm/clause" - "github.com/rjNemo/rentease/config" + "github.com/rjNemo/rentease/internal/config" ) type Service struct { diff --git a/config/config.go b/internal/config/config.go similarity index 100% rename from config/config.go rename to internal/config/config.go diff --git a/config/host.go b/internal/config/host.go similarity index 100% rename from config/host.go rename to internal/config/host.go diff --git a/constant/months.go b/internal/constant/months.go similarity index 100% rename from constant/months.go rename to internal/constant/months.go diff --git a/constant/routes.go b/internal/constant/routes.go similarity index 100% rename from constant/routes.go rename to internal/constant/routes.go diff --git a/internal/pdf/service.go b/internal/pdf/service.go index fe84bf0..4b68126 100644 --- a/internal/pdf/service.go +++ b/internal/pdf/service.go @@ -12,8 +12,8 @@ import ( "github.com/labstack/gommon/log" u "github.com/rjNemo/underscore" - "github.com/rjNemo/rentease/config" "github.com/rjNemo/rentease/internal/booking" + "github.com/rjNemo/rentease/internal/config" ) type PdfService struct { diff --git a/internal/server/auth.go b/internal/server/auth.go index a49203d..915c814 100644 --- a/internal/server/auth.go +++ b/internal/server/auth.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo-contrib/session" "github.com/labstack/echo/v4" - "github.com/rjNemo/rentease/constant" + "github.com/rjNemo/rentease/internal/constant" ) func MakeAuthMiddleware() echo.MiddlewareFunc { diff --git a/internal/server/handle_auth.go b/internal/server/handle_auth.go index f78d15a..c87c157 100644 --- a/internal/server/handle_auth.go +++ b/internal/server/handle_auth.go @@ -7,8 +7,8 @@ import ( "github.com/labstack/echo-contrib/session" "github.com/labstack/echo/v4" - "github.com/rjNemo/rentease/constant" "github.com/rjNemo/rentease/internal/auth" + "github.com/rjNemo/rentease/internal/constant" "github.com/rjNemo/rentease/internal/view" ) diff --git a/internal/server/handle_bookings.go b/internal/server/handle_bookings.go index 15fc027..e0bceb4 100644 --- a/internal/server/handle_bookings.go +++ b/internal/server/handle_bookings.go @@ -13,10 +13,10 @@ import ( "github.com/labstack/gommon/log" u "github.com/rjNemo/underscore" - "github.com/rjNemo/rentease/config" - "github.com/rjNemo/rentease/constant" "github.com/rjNemo/rentease/internal/booking" "github.com/rjNemo/rentease/internal/calendar" + "github.com/rjNemo/rentease/internal/config" + "github.com/rjNemo/rentease/internal/constant" "github.com/rjNemo/rentease/internal/view" myTime "github.com/rjNemo/rentease/pkg/time" ) diff --git a/internal/server/handle_pdf.go b/internal/server/handle_pdf.go index 8188b31..c6c9457 100644 --- a/internal/server/handle_pdf.go +++ b/internal/server/handle_pdf.go @@ -8,8 +8,8 @@ import ( "github.com/labstack/echo/v4" u "github.com/rjNemo/underscore" - "github.com/rjNemo/rentease/config" "github.com/rjNemo/rentease/internal/booking" + "github.com/rjNemo/rentease/internal/config" "github.com/rjNemo/rentease/internal/pdf" ) diff --git a/internal/server/handle_reports.go b/internal/server/handle_reports.go index b2cdfb6..d161710 100644 --- a/internal/server/handle_reports.go +++ b/internal/server/handle_reports.go @@ -10,9 +10,9 @@ import ( "github.com/labstack/echo/v4" u "github.com/rjNemo/underscore" - "github.com/rjNemo/rentease/config" - "github.com/rjNemo/rentease/constant" "github.com/rjNemo/rentease/internal/booking" + "github.com/rjNemo/rentease/internal/config" + "github.com/rjNemo/rentease/internal/constant" "github.com/rjNemo/rentease/internal/view" ) diff --git a/internal/server/server.go b/internal/server/server.go index a1316fa..4b5d13e 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -17,10 +17,10 @@ import ( "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" - "github.com/rjNemo/rentease/config" "github.com/rjNemo/rentease/internal/auth" "github.com/rjNemo/rentease/internal/booking" "github.com/rjNemo/rentease/internal/calendar" + "github.com/rjNemo/rentease/internal/config" "github.com/rjNemo/rentease/internal/pdf" ) diff --git a/internal/view/component/request_booking_form.templ b/internal/view/component/request_booking_form.templ index 6df9d08..0812053 100644 --- a/internal/view/component/request_booking_form.templ +++ b/internal/view/component/request_booking_form.templ @@ -1,6 +1,6 @@ package component -import "github.com/rjNemo/rentease/config" +import "github.com/rjNemo/rentease/internal/config" type RequestBookingViewModel struct { Item string diff --git a/internal/view/component/request_booking_form_templ.go b/internal/view/component/request_booking_form_templ.go index ee45108..6d56df9 100644 --- a/internal/view/component/request_booking_form_templ.go +++ b/internal/view/component/request_booking_form_templ.go @@ -8,7 +8,7 @@ package component import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "github.com/rjNemo/rentease/config" +import "github.com/rjNemo/rentease/internal/config" type RequestBookingViewModel struct { Item string diff --git a/internal/view/layout/public.templ b/internal/view/layout/public.templ index f5b5b06..b7a0f66 100644 --- a/internal/view/layout/public.templ +++ b/internal/view/layout/public.templ @@ -2,7 +2,7 @@ package layout import ( "fmt" - "github.com/rjNemo/rentease/config" + "github.com/rjNemo/rentease/internal/config" ) type HostViewModel struct { diff --git a/internal/view/layout/public_templ.go b/internal/view/layout/public_templ.go index 380fb2f..e082b19 100644 --- a/internal/view/layout/public_templ.go +++ b/internal/view/layout/public_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "fmt" - "github.com/rjNemo/rentease/config" + "github.com/rjNemo/rentease/internal/config" ) type HostViewModel struct { diff --git a/main.go b/main.go index d5946ec..f3b0aee 100644 --- a/main.go +++ b/main.go @@ -11,10 +11,10 @@ import ( "github.com/getsentry/sentry-go" - "github.com/rjNemo/rentease/config" "github.com/rjNemo/rentease/internal/auth" "github.com/rjNemo/rentease/internal/booking" "github.com/rjNemo/rentease/internal/calendar" + "github.com/rjNemo/rentease/internal/config" "github.com/rjNemo/rentease/internal/database" "github.com/rjNemo/rentease/internal/pdf" "github.com/rjNemo/rentease/internal/server"