diff --git a/database/connection.go b/database/connection.go index c36b088..104f14f 100644 --- a/database/connection.go +++ b/database/connection.go @@ -1,7 +1,7 @@ package database import ( - "GoWeb/app" + "GoWeb/internal" "database/sql" "fmt" _ "github.com/lib/pq" diff --git a/database/migrate.go b/database/migrate.go index a5b42dc..b7ced1e 100644 --- a/database/migrate.go +++ b/database/migrate.go @@ -1,7 +1,7 @@ package database import ( - "GoWeb/app" + "GoWeb/internal" "errors" "fmt" "github.com/lib/pq" diff --git a/env_example.json b/env_example.json index e70c6d8..d35b6c0 100644 --- a/env_example.json +++ b/env_example.json @@ -12,7 +12,7 @@ "HttpPort": "8090" }, "Template": { - "BaseTemplateName": "app/frontend/templates/base.html", - "ContentPath": "app/frontend/templates" + "BaseTemplateName": "internal/frontend/templates/base.html", + "ContentPath": "internal/frontend/templates" } } \ No newline at end of file diff --git a/app/controllers/get.go b/internal/controllers/get.go similarity index 96% rename from app/controllers/get.go rename to internal/controllers/get.go index 404ea66..c95d056 100644 --- a/app/controllers/get.go +++ b/internal/controllers/get.go @@ -1,8 +1,8 @@ package controllers import ( - "GoWeb/app" - "GoWeb/app/models" + "GoWeb/internal" + "GoWeb/internal/models" "GoWeb/security" "GoWeb/templating" "net/http" diff --git a/app/controllers/post.go b/internal/controllers/post.go similarity index 96% rename from app/controllers/post.go rename to internal/controllers/post.go index 27c6660..79c6314 100644 --- a/app/controllers/post.go +++ b/internal/controllers/post.go @@ -1,8 +1,8 @@ package controllers import ( - "GoWeb/app" - "GoWeb/app/models" + "GoWeb/internal" + "GoWeb/internal/models" "log/slog" "net/http" "time" diff --git a/app/frontend/static/css/style.css b/internal/frontend/static/css/style.css similarity index 100% rename from app/frontend/static/css/style.css rename to internal/frontend/static/css/style.css diff --git a/app/frontend/templates/base.html b/internal/frontend/templates/base.html similarity index 100% rename from app/frontend/templates/base.html rename to internal/frontend/templates/base.html diff --git a/app/frontend/templates/pages/home.html b/internal/frontend/templates/pages/home.html similarity index 100% rename from app/frontend/templates/pages/home.html rename to internal/frontend/templates/pages/home.html diff --git a/app/frontend/templates/pages/login.html b/internal/frontend/templates/pages/login.html similarity index 100% rename from app/frontend/templates/pages/login.html rename to internal/frontend/templates/pages/login.html diff --git a/app/frontend/templates/pages/register.html b/internal/frontend/templates/pages/register.html similarity index 100% rename from app/frontend/templates/pages/register.html rename to internal/frontend/templates/pages/register.html diff --git a/app/globals.go b/internal/globals.go similarity index 100% rename from app/globals.go rename to internal/globals.go diff --git a/app/middleware/csrf.go b/internal/middleware/csrf.go similarity index 100% rename from app/middleware/csrf.go rename to internal/middleware/csrf.go diff --git a/app/middleware/wrapper.go b/internal/middleware/wrapper.go similarity index 100% rename from app/middleware/wrapper.go rename to internal/middleware/wrapper.go diff --git a/app/models/migrations.go b/internal/models/migrations.go similarity index 97% rename from app/models/migrations.go rename to internal/models/migrations.go index 9bdac20..80a299b 100644 --- a/app/models/migrations.go +++ b/internal/models/migrations.go @@ -1,8 +1,8 @@ package models import ( - "GoWeb/app" "GoWeb/database" + "GoWeb/internal" "time" ) diff --git a/app/models/session.go b/internal/models/session.go similarity index 99% rename from app/models/session.go rename to internal/models/session.go index 438453e..3cf0dce 100644 --- a/app/models/session.go +++ b/internal/models/session.go @@ -1,7 +1,7 @@ package models import ( - "GoWeb/app" + "GoWeb/internal" "crypto/rand" "encoding/hex" "log/slog" diff --git a/app/models/user.go b/internal/models/user.go similarity index 99% rename from app/models/user.go rename to internal/models/user.go index 4880e5f..b2ddf81 100644 --- a/app/models/user.go +++ b/internal/models/user.go @@ -1,7 +1,7 @@ package models import ( - "GoWeb/app" + "GoWeb/internal" "crypto/sha256" "encoding/hex" "log/slog" diff --git a/app/routes/get.go b/internal/routes/get.go similarity index 93% rename from app/routes/get.go rename to internal/routes/get.go index 28089d2..9754a27 100644 --- a/app/routes/get.go +++ b/internal/routes/get.go @@ -1,8 +1,8 @@ package routes import ( - "GoWeb/app" - "GoWeb/app/controllers" + "GoWeb/internal" + "GoWeb/internal/controllers" "io/fs" "log/slog" "net/http" diff --git a/app/routes/post.go b/internal/routes/post.go similarity index 83% rename from app/routes/post.go rename to internal/routes/post.go index 344d8f4..c6a7bfd 100644 --- a/app/routes/post.go +++ b/internal/routes/post.go @@ -1,9 +1,9 @@ package routes import ( - "GoWeb/app" - "GoWeb/app/controllers" - "GoWeb/app/middleware" + "GoWeb/internal" + "GoWeb/internal/controllers" + "GoWeb/internal/middleware" "net/http" ) diff --git a/app/scheduler.go b/internal/scheduler.go similarity index 100% rename from app/scheduler.go rename to internal/scheduler.go diff --git a/main.go b/main.go index 54f6e60..495ecaa 100644 --- a/main.go +++ b/main.go @@ -1,11 +1,11 @@ package main import ( - "GoWeb/app" - "GoWeb/app/models" - "GoWeb/app/routes" "GoWeb/config" "GoWeb/database" + "GoWeb/internal" + "GoWeb/internal/models" + "GoWeb/internal/routes" "GoWeb/templating" "context" "embed" @@ -18,7 +18,7 @@ import ( "time" ) -//go:embed app/frontend/templates app/frontend/static +//go:embed internal/frontend/templates internal/frontend/static var res embed.FS func main() { diff --git a/templating/builder.go b/templating/builder.go index d8c1de6..fddf009 100644 --- a/templating/builder.go +++ b/templating/builder.go @@ -1,7 +1,7 @@ package templating import ( - "GoWeb/app" + "GoWeb/internal" "fmt" "html/template" "io/fs" @@ -9,7 +9,7 @@ import ( "net/http" ) -var templates = make(map[string]*template.Template) // This is only used here, does not need to be in app.Deps +var templates = make(map[string]*template.Template) // This is only used here, does not need to be in internal.Deps func BuildPages(app *app.Deps) error { basePath := app.Config.Template.BaseName