From 9e03bdb2de282bc29ff1f9d15d5a98b2871cbc91 Mon Sep 17 00:00:00 2001 From: soup Date: Fri, 15 Nov 2024 15:20:56 -0500 Subject: [PATCH] lift things out of backend/ --- Makefile | 4 ++-- {backend/auth => auth}/auth.go | 0 {backend/bin => bin}/shelves.go | 6 +++--- {backend/db => db}/db.go | 0 {backend/errorsx => errorsx}/errorsx.go | 0 {backend/forms => forms}/forms.go | 0 {backend/httpx => httpx}/httpx.go | 4 ++-- {backend/httpx => httpx}/hx.go | 0 {backend/httpx => httpx}/middleware.go | 2 +- {backend/routes => routes}/home.go | 4 ++-- {backend/routes => routes}/login.go | 10 +++++----- {backend/routes => routes}/routes.go | 2 +- {backend/routes => routes}/settings.go | 10 +++++----- {backend/templates => templates}/form.go | 0 {backend/templates => templates}/page.go | 2 +- {backend/templates => templates}/templates.go | 0 {backend/templates => templates}/tmpls/form.tmpl.html | 0 {backend/templates => templates}/tmpls/home.tmpl.html | 0 {backend/templates => templates}/tmpls/page.tmpl.html | 0 .../templates => templates}/tmpls/page_base.tmpl.html | 0 {backend/urls => urls}/urls.go | 0 21 files changed, 22 insertions(+), 22 deletions(-) rename {backend/auth => auth}/auth.go (100%) rename {backend/bin => bin}/shelves.go (92%) rename {backend/db => db}/db.go (100%) rename {backend/errorsx => errorsx}/errorsx.go (100%) rename {backend/forms => forms}/forms.go (100%) rename {backend/httpx => httpx}/httpx.go (94%) rename {backend/httpx => httpx}/hx.go (100%) rename {backend/httpx => httpx}/middleware.go (98%) rename {backend/routes => routes}/home.go (85%) rename {backend/routes => routes}/login.go (95%) rename {backend/routes => routes}/routes.go (98%) rename {backend/routes => routes}/settings.go (96%) rename {backend/templates => templates}/form.go (100%) rename {backend/templates => templates}/page.go (95%) rename {backend/templates => templates}/templates.go (100%) rename {backend/templates => templates}/tmpls/form.tmpl.html (100%) rename {backend/templates => templates}/tmpls/home.tmpl.html (100%) rename {backend/templates => templates}/tmpls/page.tmpl.html (100%) rename {backend/templates => templates}/tmpls/page_base.tmpl.html (100%) rename {backend/urls => urls}/urls.go (100%) diff --git a/Makefile b/Makefile index 38fdeac..1e92b18 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ .PHONY: build build: - go build backend/bin/shelves.go + go build bin/shelves.go run: - go run backend/bin/shelves.go + go run bin/shelves.go watch: fd | entr -cr make run diff --git a/backend/auth/auth.go b/auth/auth.go similarity index 100% rename from backend/auth/auth.go rename to auth/auth.go diff --git a/backend/bin/shelves.go b/bin/shelves.go similarity index 92% rename from backend/bin/shelves.go rename to bin/shelves.go index e021bbe..3ec7a14 100644 --- a/backend/bin/shelves.go +++ b/bin/shelves.go @@ -7,9 +7,9 @@ import ( _ "github.com/mattn/go-sqlite3" - "shelves/backend/db" - "shelves/backend/httpx" - "shelves/backend/routes" + "shelves/db" + "shelves/httpx" + "shelves/routes" ) func main() { diff --git a/backend/db/db.go b/db/db.go similarity index 100% rename from backend/db/db.go rename to db/db.go diff --git a/backend/errorsx/errorsx.go b/errorsx/errorsx.go similarity index 100% rename from backend/errorsx/errorsx.go rename to errorsx/errorsx.go diff --git a/backend/forms/forms.go b/forms/forms.go similarity index 100% rename from backend/forms/forms.go rename to forms/forms.go diff --git a/backend/httpx/httpx.go b/httpx/httpx.go similarity index 94% rename from backend/httpx/httpx.go rename to httpx/httpx.go index 6a250a7..e275cd2 100644 --- a/backend/httpx/httpx.go +++ b/httpx/httpx.go @@ -4,8 +4,8 @@ import ( "log" "net/http" "net/url" - "shelves/backend/errorsx" - "shelves/backend/urls" + "shelves/errorsx" + "shelves/urls" ) func SeeOther(w http.ResponseWriter, location string) { diff --git a/backend/httpx/hx.go b/httpx/hx.go similarity index 100% rename from backend/httpx/hx.go rename to httpx/hx.go diff --git a/backend/httpx/middleware.go b/httpx/middleware.go similarity index 98% rename from backend/httpx/middleware.go rename to httpx/middleware.go index abc151e..1fe7b63 100644 --- a/backend/httpx/middleware.go +++ b/httpx/middleware.go @@ -5,7 +5,7 @@ import ( "database/sql" "log" "net/http" - "shelves/backend/auth" + "shelves/auth" "time" ) diff --git a/backend/routes/home.go b/routes/home.go similarity index 85% rename from backend/routes/home.go rename to routes/home.go index 3d05a92..5cd01ac 100644 --- a/backend/routes/home.go +++ b/routes/home.go @@ -2,8 +2,8 @@ package routes import ( "net/http" - "shelves/backend/httpx" - "shelves/backend/templates" + "shelves/httpx" + "shelves/templates" ) type homeTemplate struct { diff --git a/backend/routes/login.go b/routes/login.go similarity index 95% rename from backend/routes/login.go rename to routes/login.go index 9c659e9..32ab6d8 100644 --- a/backend/routes/login.go +++ b/routes/login.go @@ -5,11 +5,11 @@ import ( "html/template" "net/http" "net/url" - "shelves/backend/auth" - "shelves/backend/errorsx" - "shelves/backend/forms" - "shelves/backend/httpx" - "shelves/backend/templates" + "shelves/auth" + "shelves/errorsx" + "shelves/forms" + "shelves/httpx" + "shelves/templates" ) type loginForm struct { diff --git a/backend/routes/routes.go b/routes/routes.go similarity index 98% rename from backend/routes/routes.go rename to routes/routes.go index 5ce721d..c824b6e 100644 --- a/backend/routes/routes.go +++ b/routes/routes.go @@ -3,7 +3,7 @@ package routes import ( "html/template" "net/http" - "shelves/backend/httpx" + "shelves/httpx" "strings" "time" diff --git a/backend/routes/settings.go b/routes/settings.go similarity index 96% rename from backend/routes/settings.go rename to routes/settings.go index 7ec70ae..a53f3a7 100644 --- a/backend/routes/settings.go +++ b/routes/settings.go @@ -6,11 +6,11 @@ import ( "html/template" "net/http" "net/url" - "shelves/backend/auth" - "shelves/backend/errorsx" - "shelves/backend/forms" - "shelves/backend/httpx" - "shelves/backend/templates" + "shelves/auth" + "shelves/errorsx" + "shelves/forms" + "shelves/httpx" + "shelves/templates" ) func settingsRenderView(f settingsForm, e settingsFormErrors) template.HTML { diff --git a/backend/templates/form.go b/templates/form.go similarity index 100% rename from backend/templates/form.go rename to templates/form.go diff --git a/backend/templates/page.go b/templates/page.go similarity index 95% rename from backend/templates/page.go rename to templates/page.go index 49d9e41..72a0f05 100644 --- a/backend/templates/page.go +++ b/templates/page.go @@ -2,7 +2,7 @@ package templates import ( "html/template" - "shelves/backend/auth" + "shelves/auth" ) type PageBase struct { diff --git a/backend/templates/templates.go b/templates/templates.go similarity index 100% rename from backend/templates/templates.go rename to templates/templates.go diff --git a/backend/templates/tmpls/form.tmpl.html b/templates/tmpls/form.tmpl.html similarity index 100% rename from backend/templates/tmpls/form.tmpl.html rename to templates/tmpls/form.tmpl.html diff --git a/backend/templates/tmpls/home.tmpl.html b/templates/tmpls/home.tmpl.html similarity index 100% rename from backend/templates/tmpls/home.tmpl.html rename to templates/tmpls/home.tmpl.html diff --git a/backend/templates/tmpls/page.tmpl.html b/templates/tmpls/page.tmpl.html similarity index 100% rename from backend/templates/tmpls/page.tmpl.html rename to templates/tmpls/page.tmpl.html diff --git a/backend/templates/tmpls/page_base.tmpl.html b/templates/tmpls/page_base.tmpl.html similarity index 100% rename from backend/templates/tmpls/page_base.tmpl.html rename to templates/tmpls/page_base.tmpl.html diff --git a/backend/urls/urls.go b/urls/urls.go similarity index 100% rename from backend/urls/urls.go rename to urls/urls.go