From 9b938ccff36b9d661b89ea2bdfb72e31e4eced3c Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sun, 23 Dec 2018 16:21:50 -0800 Subject: [PATCH] Move package from internal to src --- blog.go | 28 +++++++++---------- errors.go | 6 ++-- pages.go | 10 +++---- {internal => src}/controllers/admin/admin.go | 4 +-- .../controllers/admin/admin_doc.go | 0 {internal => src}/controllers/admin/editor.go | 4 +-- .../controllers/admin/settings.go | 6 ++-- .../controllers/authctl/age-gate.go | 8 +++--- .../controllers/authctl/authctl.go | 12 ++++---- .../controllers/authctl/authctl_doc.go | 0 .../controllers/comments/comments.go | 14 +++++----- .../controllers/comments/comments_doc.go | 0 .../controllers/comments/subscriptions.go | 4 +-- .../controllers/contact/contact.go | 12 ++++---- .../controllers/events/contact-auth.go | 6 ++-- {internal => src}/controllers/events/edit.go | 6 ++-- .../controllers/events/events.go | 8 +++--- .../controllers/events/events_doc.go | 0 .../controllers/events/invite.go | 6 ++-- .../controllers/events/notifier.go | 2 +- .../controllers/posts/archive.go | 8 +++--- {internal => src}/controllers/posts/edit.go | 10 +++---- {internal => src}/controllers/posts/feeds.go | 2 +- {internal => src}/controllers/posts/index.go | 6 ++-- {internal => src}/controllers/posts/posts.go | 12 ++++---- .../controllers/posts/posts_doc.go | 0 {internal => src}/controllers/posts/tagged.go | 2 +- .../controllers/questions/questions.go | 12 ++++---- .../controllers/questions/questions_doc.go | 0 {internal => src}/controllers/setup/setup.go | 12 ++++---- {internal => src}/forms/auth.go | 0 {internal => src}/forms/contact.go | 0 {internal => src}/forms/forms.go | 0 {internal => src}/forms/settings.go | 0 {internal => src}/forms/setup.go | 0 {internal => src}/log/log.go | 0 {internal => src}/mail/mail.go | 6 ++-- {internal => src}/markdown/markdown.go | 2 +- {internal => src}/middleware/age-gate.go | 4 +-- {internal => src}/middleware/auth/auth.go | 4 +-- {internal => src}/middleware/csrf.go | 4 +-- {internal => src}/render/functions.go | 2 +- {internal => src}/render/resolve_paths.go | 2 +- {internal => src}/render/templates.go | 10 +++---- {internal => src}/responses/responses.go | 2 +- {internal => src}/sessions/sessions.go | 4 +-- {internal => src}/types/constants.go | 0 {internal => src}/types/context.go | 0 48 files changed, 120 insertions(+), 120 deletions(-) rename {internal => src}/controllers/admin/admin.go (87%) rename {internal => src}/controllers/admin/admin_doc.go (100%) rename {internal => src}/controllers/admin/editor.go (97%) rename {internal => src}/controllers/admin/settings.go (95%) rename {internal => src}/controllers/authctl/age-gate.go (77%) rename {internal => src}/controllers/authctl/authctl.go (93%) rename {internal => src}/controllers/authctl/authctl_doc.go (100%) rename {internal => src}/controllers/comments/comments.go (96%) rename {internal => src}/controllers/comments/comments_doc.go (100%) rename {internal => src}/controllers/comments/subscriptions.go (92%) rename {internal => src}/controllers/contact/contact.go (91%) rename {internal => src}/controllers/events/contact-auth.go (95%) rename {internal => src}/controllers/events/edit.go (90%) rename {internal => src}/controllers/events/events.go (95%) rename {internal => src}/controllers/events/events_doc.go (100%) rename {internal => src}/controllers/events/invite.go (96%) rename {internal => src}/controllers/events/notifier.go (96%) rename {internal => src}/controllers/posts/archive.go (88%) rename {internal => src}/controllers/posts/edit.go (91%) rename {internal => src}/controllers/posts/feeds.go (96%) rename {internal => src}/controllers/posts/index.go (96%) rename {internal => src}/controllers/posts/posts.go (95%) rename {internal => src}/controllers/posts/posts_doc.go (100%) rename {internal => src}/controllers/posts/tagged.go (95%) rename {internal => src}/controllers/questions/questions.go (93%) rename {internal => src}/controllers/questions/questions_doc.go (100%) rename {internal => src}/controllers/setup/setup.go (84%) rename {internal => src}/forms/auth.go (100%) rename {internal => src}/forms/contact.go (100%) rename {internal => src}/forms/forms.go (100%) rename {internal => src}/forms/settings.go (100%) rename {internal => src}/forms/setup.go (100%) rename {internal => src}/log/log.go (100%) rename {internal => src}/mail/mail.go (97%) rename {internal => src}/markdown/markdown.go (99%) rename {internal => src}/middleware/age-gate.go (92%) rename {internal => src}/middleware/auth/auth.go (95%) rename {internal => src}/middleware/csrf.go (94%) rename {internal => src}/render/functions.go (91%) rename {internal => src}/render/resolve_paths.go (98%) rename {internal => src}/render/templates.go (94%) rename {internal => src}/responses/responses.go (96%) rename {internal => src}/sessions/sessions.go (95%) rename {internal => src}/types/constants.go (100%) rename {internal => src}/types/context.go (100%) diff --git a/blog.go b/blog.go index 83b7737..c79a3e9 100644 --- a/blog.go +++ b/blog.go @@ -9,20 +9,20 @@ import ( "github.com/gorilla/mux" "github.com/jinzhu/gorm" - "github.com/kirsle/blog/internal/controllers/admin" - "github.com/kirsle/blog/internal/controllers/authctl" - commentctl "github.com/kirsle/blog/internal/controllers/comments" - "github.com/kirsle/blog/internal/controllers/contact" - postctl "github.com/kirsle/blog/internal/controllers/posts" - questionsctl "github.com/kirsle/blog/internal/controllers/questions" - "github.com/kirsle/blog/internal/controllers/setup" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/middleware" - "github.com/kirsle/blog/internal/middleware/auth" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/controllers/admin" + "github.com/kirsle/blog/src/controllers/authctl" + commentctl "github.com/kirsle/blog/src/controllers/comments" + "github.com/kirsle/blog/src/controllers/contact" + postctl "github.com/kirsle/blog/src/controllers/posts" + questionsctl "github.com/kirsle/blog/src/controllers/questions" + "github.com/kirsle/blog/src/controllers/setup" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/middleware" + "github.com/kirsle/blog/src/middleware/auth" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/sessions" "github.com/kirsle/blog/jsondb" "github.com/kirsle/blog/jsondb/caches" "github.com/kirsle/blog/jsondb/caches/null" diff --git a/errors.go b/errors.go index 36fb631..004dcc3 100644 --- a/errors.go +++ b/errors.go @@ -3,9 +3,9 @@ package blog import ( "net/http" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" ) // registerErrors loads the error handlers into the responses subpackage. diff --git a/pages.go b/pages.go index f168727..fdafe7b 100644 --- a/pages.go +++ b/pages.go @@ -6,11 +6,11 @@ import ( "net/http" "strings" - "github.com/kirsle/blog/internal/controllers/posts" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/controllers/posts" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" ) // PageHandler is the catch-all route handler, for serving static web pages. diff --git a/internal/controllers/admin/admin.go b/src/controllers/admin/admin.go similarity index 87% rename from internal/controllers/admin/admin.go rename to src/controllers/admin/admin.go index 92783f4..861d279 100644 --- a/internal/controllers/admin/admin.go +++ b/src/controllers/admin/admin.go @@ -4,8 +4,8 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/middleware/auth" - "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/src/middleware/auth" + "github.com/kirsle/blog/src/render" "github.com/urfave/negroni" ) diff --git a/internal/controllers/admin/admin_doc.go b/src/controllers/admin/admin_doc.go similarity index 100% rename from internal/controllers/admin/admin_doc.go rename to src/controllers/admin/admin_doc.go diff --git a/internal/controllers/admin/editor.go b/src/controllers/admin/editor.go similarity index 97% rename from internal/controllers/admin/editor.go rename to src/controllers/admin/editor.go index 37b86f6..fd96322 100644 --- a/internal/controllers/admin/editor.go +++ b/src/controllers/admin/editor.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" ) // FileTree holds information about files in the document roots. diff --git a/internal/controllers/admin/settings.go b/src/controllers/admin/settings.go similarity index 95% rename from internal/controllers/admin/settings.go rename to src/controllers/admin/settings.go index cce1010..107864c 100644 --- a/internal/controllers/admin/settings.go +++ b/src/controllers/admin/settings.go @@ -4,9 +4,9 @@ import ( "net/http" "strconv" - "github.com/kirsle/blog/internal/forms" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/forms" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" "github.com/kirsle/blog/models/settings" ) diff --git a/internal/controllers/authctl/age-gate.go b/src/controllers/authctl/age-gate.go similarity index 77% rename from internal/controllers/authctl/age-gate.go rename to src/controllers/authctl/age-gate.go index 7f72f91..0f6e1c5 100644 --- a/internal/controllers/authctl/age-gate.go +++ b/src/controllers/authctl/age-gate.go @@ -3,10 +3,10 @@ package authctl import ( "net/http" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/sessions" ) // AgeGate handles age verification for NSFW blogs. diff --git a/internal/controllers/authctl/authctl.go b/src/controllers/authctl/authctl.go similarity index 93% rename from internal/controllers/authctl/authctl.go rename to src/controllers/authctl/authctl.go index e9043c6..dae0f2e 100644 --- a/internal/controllers/authctl/authctl.go +++ b/src/controllers/authctl/authctl.go @@ -5,13 +5,13 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/forms" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/src/forms" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/middleware/auth" "github.com/kirsle/blog/models/users" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/sessions" ) // Register the initial setup routes. diff --git a/internal/controllers/authctl/authctl_doc.go b/src/controllers/authctl/authctl_doc.go similarity index 100% rename from internal/controllers/authctl/authctl_doc.go rename to src/controllers/authctl/authctl_doc.go diff --git a/internal/controllers/comments/comments.go b/src/controllers/comments/comments.go similarity index 96% rename from internal/controllers/comments/comments.go rename to src/controllers/comments/comments.go index 7cd2d18..ceafb35 100644 --- a/internal/controllers/comments/comments.go +++ b/src/controllers/comments/comments.go @@ -8,15 +8,15 @@ import ( "github.com/google/uuid" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/mail" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/mail" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/middleware/auth" "github.com/kirsle/blog/models/comments" "github.com/kirsle/blog/models/users" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/sessions" ) var badRequest func(http.ResponseWriter, *http.Request, string) diff --git a/internal/controllers/comments/comments_doc.go b/src/controllers/comments/comments_doc.go similarity index 100% rename from internal/controllers/comments/comments_doc.go rename to src/controllers/comments/comments_doc.go diff --git a/internal/controllers/comments/subscriptions.go b/src/controllers/comments/subscriptions.go similarity index 92% rename from internal/controllers/comments/subscriptions.go rename to src/controllers/comments/subscriptions.go index d2b100a..0beac3c 100644 --- a/internal/controllers/comments/subscriptions.go +++ b/src/controllers/comments/subscriptions.go @@ -5,8 +5,8 @@ import ( "net/mail" "github.com/kirsle/blog/models/comments" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" ) func subscriptionHandler(w http.ResponseWriter, r *http.Request) { diff --git a/internal/controllers/contact/contact.go b/src/controllers/contact/contact.go similarity index 91% rename from internal/controllers/contact/contact.go rename to src/controllers/contact/contact.go index 57fe0dd..63bb0ca 100644 --- a/internal/controllers/contact/contact.go +++ b/src/controllers/contact/contact.go @@ -9,12 +9,12 @@ import ( "time" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/forms" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/mail" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/forms" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/mail" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" "github.com/kirsle/blog/models/settings" ) diff --git a/internal/controllers/events/contact-auth.go b/src/controllers/events/contact-auth.go similarity index 95% rename from internal/controllers/events/contact-auth.go rename to src/controllers/events/contact-auth.go index 4bc0038..e059f60 100644 --- a/internal/controllers/events/contact-auth.go +++ b/src/controllers/events/contact-auth.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/sessions" "github.com/kirsle/blog/models/contacts" "github.com/kirsle/blog/models/events" ) diff --git a/internal/controllers/events/edit.go b/src/controllers/events/edit.go similarity index 90% rename from internal/controllers/events/edit.go rename to src/controllers/events/edit.go index 80244e8..dc1eab5 100644 --- a/internal/controllers/events/edit.go +++ b/src/controllers/events/edit.go @@ -5,9 +5,9 @@ import ( "net/http" "strconv" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" "github.com/kirsle/blog/models/events" ) diff --git a/internal/controllers/events/events.go b/src/controllers/events/events.go similarity index 95% rename from internal/controllers/events/events.go rename to src/controllers/events/events.go index f0987a0..8f82e74 100644 --- a/internal/controllers/events/events.go +++ b/src/controllers/events/events.go @@ -6,10 +6,10 @@ import ( "sort" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/middleware/auth" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/middleware/auth" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" "github.com/kirsle/blog/models/comments" "github.com/kirsle/blog/models/events" "github.com/urfave/negroni" diff --git a/internal/controllers/events/events_doc.go b/src/controllers/events/events_doc.go similarity index 100% rename from internal/controllers/events/events_doc.go rename to src/controllers/events/events_doc.go diff --git a/internal/controllers/events/invite.go b/src/controllers/events/invite.go similarity index 96% rename from internal/controllers/events/invite.go rename to src/controllers/events/invite.go index 72d424d..a55f647 100644 --- a/internal/controllers/events/invite.go +++ b/src/controllers/events/invite.go @@ -6,9 +6,9 @@ import ( "strings" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" "github.com/kirsle/blog/models/contacts" "github.com/kirsle/blog/models/events" ) diff --git a/internal/controllers/events/notifier.go b/src/controllers/events/notifier.go similarity index 96% rename from internal/controllers/events/notifier.go rename to src/controllers/events/notifier.go index 5dd6eb4..a7aa917 100644 --- a/internal/controllers/events/notifier.go +++ b/src/controllers/events/notifier.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/kirsle/blog/internal/mail" + "github.com/kirsle/blog/src/mail" "github.com/kirsle/blog/models/events" "github.com/kirsle/blog/models/settings" ) diff --git a/internal/controllers/posts/archive.go b/src/controllers/posts/archive.go similarity index 88% rename from internal/controllers/posts/archive.go rename to src/controllers/posts/archive.go index 875cb0c..c99a69d 100644 --- a/internal/controllers/posts/archive.go +++ b/src/controllers/posts/archive.go @@ -5,11 +5,11 @@ import ( "sort" "time" - "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/src/middleware/auth" "github.com/kirsle/blog/models/posts" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/types" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/types" ) // archiveHandler summarizes all blog entries in an archive view. diff --git a/internal/controllers/posts/edit.go b/src/controllers/posts/edit.go similarity index 91% rename from internal/controllers/posts/edit.go rename to src/controllers/posts/edit.go index 5b6102c..03bd17e 100644 --- a/internal/controllers/posts/edit.go +++ b/src/controllers/posts/edit.go @@ -7,11 +7,11 @@ import ( "strconv" "time" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/middleware/auth" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/types" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/middleware/auth" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/types" "github.com/kirsle/blog/models/posts" ) diff --git a/internal/controllers/posts/feeds.go b/src/controllers/posts/feeds.go similarity index 96% rename from internal/controllers/posts/feeds.go rename to src/controllers/posts/feeds.go index 2b3bbac..de9ed2e 100644 --- a/internal/controllers/posts/feeds.go +++ b/src/controllers/posts/feeds.go @@ -6,7 +6,7 @@ import ( "time" "github.com/gorilla/feeds" - "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/src/responses" "github.com/kirsle/blog/models/posts" "github.com/kirsle/blog/models/settings" "github.com/kirsle/blog/models/users" diff --git a/internal/controllers/posts/index.go b/src/controllers/posts/index.go similarity index 96% rename from internal/controllers/posts/index.go rename to src/controllers/posts/index.go index 4f869d0..79cc415 100644 --- a/internal/controllers/posts/index.go +++ b/src/controllers/posts/index.go @@ -8,9 +8,9 @@ import ( "net/http" "strconv" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/types" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/types" "github.com/kirsle/blog/models/comments" "github.com/kirsle/blog/models/posts" "github.com/kirsle/blog/models/users" diff --git a/internal/controllers/posts/posts.go b/src/controllers/posts/posts.go similarity index 95% rename from internal/controllers/posts/posts.go rename to src/controllers/posts/posts.go index db9846f..c7f7c62 100644 --- a/internal/controllers/posts/posts.go +++ b/src/controllers/posts/posts.go @@ -10,14 +10,14 @@ import ( "time" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/middleware/auth" "github.com/kirsle/blog/models/posts" "github.com/kirsle/blog/models/users" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/types" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/types" "github.com/urfave/negroni" ) diff --git a/internal/controllers/posts/posts_doc.go b/src/controllers/posts/posts_doc.go similarity index 100% rename from internal/controllers/posts/posts_doc.go rename to src/controllers/posts/posts_doc.go diff --git a/internal/controllers/posts/tagged.go b/src/controllers/posts/tagged.go similarity index 95% rename from internal/controllers/posts/tagged.go rename to src/controllers/posts/tagged.go index 72e6bc5..783c1b5 100644 --- a/internal/controllers/posts/tagged.go +++ b/src/controllers/posts/tagged.go @@ -7,7 +7,7 @@ import ( "github.com/gorilla/mux" "github.com/kirsle/blog/models/posts" - "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/src/render" ) // tagged lets you browse blog posts by category. diff --git a/internal/controllers/questions/questions.go b/src/controllers/questions/questions.go similarity index 93% rename from internal/controllers/questions/questions.go rename to src/controllers/questions/questions.go index 0f6fdfd..ab4b8f7 100644 --- a/internal/controllers/questions/questions.go +++ b/src/controllers/questions/questions.go @@ -10,12 +10,12 @@ import ( "time" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/mail" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/mail" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/sessions" "github.com/kirsle/blog/models/comments" "github.com/kirsle/blog/models/questions" "github.com/kirsle/blog/models/settings" diff --git a/internal/controllers/questions/questions_doc.go b/src/controllers/questions/questions_doc.go similarity index 100% rename from internal/controllers/questions/questions_doc.go rename to src/controllers/questions/questions_doc.go diff --git a/internal/controllers/setup/setup.go b/src/controllers/setup/setup.go similarity index 84% rename from internal/controllers/setup/setup.go rename to src/controllers/setup/setup.go index 07a65f7..2ca218b 100644 --- a/internal/controllers/setup/setup.go +++ b/src/controllers/setup/setup.go @@ -4,14 +4,14 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/kirsle/blog/internal/forms" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/src/forms" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/middleware/auth" "github.com/kirsle/blog/models/settings" "github.com/kirsle/blog/models/users" - "github.com/kirsle/blog/internal/render" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/render" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/sessions" ) // Register the initial setup routes. diff --git a/internal/forms/auth.go b/src/forms/auth.go similarity index 100% rename from internal/forms/auth.go rename to src/forms/auth.go diff --git a/internal/forms/contact.go b/src/forms/contact.go similarity index 100% rename from internal/forms/contact.go rename to src/forms/contact.go diff --git a/internal/forms/forms.go b/src/forms/forms.go similarity index 100% rename from internal/forms/forms.go rename to src/forms/forms.go diff --git a/internal/forms/settings.go b/src/forms/settings.go similarity index 100% rename from internal/forms/settings.go rename to src/forms/settings.go diff --git a/internal/forms/setup.go b/src/forms/setup.go similarity index 100% rename from internal/forms/setup.go rename to src/forms/setup.go diff --git a/internal/log/log.go b/src/log/log.go similarity index 100% rename from internal/log/log.go rename to src/log/log.go diff --git a/internal/mail/mail.go b/src/mail/mail.go similarity index 97% rename from internal/mail/mail.go rename to src/mail/mail.go index 52b9a64..12f0483 100644 --- a/internal/mail/mail.go +++ b/src/mail/mail.go @@ -8,9 +8,9 @@ import ( "net/url" "strings" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/markdown" - "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/markdown" + "github.com/kirsle/blog/src/render" "github.com/kirsle/blog/models/comments" "github.com/kirsle/blog/models/settings" "github.com/microcosm-cc/bluemonday" diff --git a/internal/markdown/markdown.go b/src/markdown/markdown.go similarity index 99% rename from internal/markdown/markdown.go rename to src/markdown/markdown.go index 6b6fc4d..f032d4a 100644 --- a/internal/markdown/markdown.go +++ b/src/markdown/markdown.go @@ -11,7 +11,7 @@ import ( "regexp" "strings" - "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/src/log" "github.com/kirsle/blog/jsondb/caches" "github.com/microcosm-cc/bluemonday" "github.com/shurcooL/github_flavored_markdown" diff --git a/internal/middleware/age-gate.go b/src/middleware/age-gate.go similarity index 92% rename from internal/middleware/age-gate.go rename to src/middleware/age-gate.go index 3a6fc0f..db4c3ba 100644 --- a/internal/middleware/age-gate.go +++ b/src/middleware/age-gate.go @@ -4,8 +4,8 @@ import ( "net/http" "strings" - "github.com/kirsle/blog/internal/responses" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/responses" + "github.com/kirsle/blog/src/sessions" "github.com/kirsle/blog/models/settings" "github.com/urfave/negroni" ) diff --git a/internal/middleware/auth/auth.go b/src/middleware/auth/auth.go similarity index 95% rename from internal/middleware/auth/auth.go rename to src/middleware/auth/auth.go index ff496c1..f03081c 100644 --- a/internal/middleware/auth/auth.go +++ b/src/middleware/auth/auth.go @@ -6,8 +6,8 @@ import ( "net/http" "github.com/kirsle/blog/models/users" - "github.com/kirsle/blog/internal/sessions" - "github.com/kirsle/blog/internal/types" + "github.com/kirsle/blog/src/sessions" + "github.com/kirsle/blog/src/types" "github.com/urfave/negroni" ) diff --git a/internal/middleware/csrf.go b/src/middleware/csrf.go similarity index 94% rename from internal/middleware/csrf.go rename to src/middleware/csrf.go index 11c4f53..307441f 100644 --- a/internal/middleware/csrf.go +++ b/src/middleware/csrf.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" gorilla "github.com/gorilla/sessions" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/sessions" "github.com/urfave/negroni" ) diff --git a/internal/render/functions.go b/src/render/functions.go similarity index 91% rename from internal/render/functions.go rename to src/render/functions.go index 37b0c68..9cc0359 100644 --- a/internal/render/functions.go +++ b/src/render/functions.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/kirsle/blog/internal/markdown" + "github.com/kirsle/blog/src/markdown" ) // Funcs is a global funcmap that the blog can hook its internal diff --git a/internal/render/resolve_paths.go b/src/render/resolve_paths.go similarity index 98% rename from internal/render/resolve_paths.go rename to src/render/resolve_paths.go index e5ca8a8..6c16548 100644 --- a/internal/render/resolve_paths.go +++ b/src/render/resolve_paths.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/src/log" ) // Blog configuration bindings. diff --git a/internal/render/templates.go b/src/render/templates.go similarity index 94% rename from internal/render/templates.go rename to src/render/templates.go index 501bf2f..d083247 100644 --- a/internal/render/templates.go +++ b/src/render/templates.go @@ -8,11 +8,11 @@ import ( "time" gorilla "github.com/gorilla/sessions" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/middleware" - "github.com/kirsle/blog/internal/middleware/auth" - "github.com/kirsle/blog/internal/sessions" - "github.com/kirsle/blog/internal/types" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/middleware" + "github.com/kirsle/blog/src/middleware/auth" + "github.com/kirsle/blog/src/sessions" + "github.com/kirsle/blog/src/types" "github.com/kirsle/blog/models/settings" "github.com/kirsle/blog/models/users" ) diff --git a/internal/responses/responses.go b/src/responses/responses.go similarity index 96% rename from internal/responses/responses.go rename to src/responses/responses.go index 3770c41..43a4878 100644 --- a/internal/responses/responses.go +++ b/src/responses/responses.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/src/sessions" ) // Error handlers to be filled in by the blog app. diff --git a/internal/sessions/sessions.go b/src/sessions/sessions.go similarity index 95% rename from internal/sessions/sessions.go rename to src/sessions/sessions.go index 6bd0ef2..b2a1a18 100644 --- a/internal/sessions/sessions.go +++ b/src/sessions/sessions.go @@ -6,8 +6,8 @@ import ( "time" "github.com/gorilla/sessions" - "github.com/kirsle/blog/internal/log" - "github.com/kirsle/blog/internal/types" + "github.com/kirsle/blog/src/log" + "github.com/kirsle/blog/src/types" ) // Store holds your cookie store information. diff --git a/internal/types/constants.go b/src/types/constants.go similarity index 100% rename from internal/types/constants.go rename to src/types/constants.go diff --git a/internal/types/context.go b/src/types/context.go similarity index 100% rename from internal/types/context.go rename to src/types/context.go