diff --git a/cmd/blog/main.go b/cmd/blog/main.go index 64aa718..1937f9e 100644 --- a/cmd/blog/main.go +++ b/cmd/blog/main.go @@ -10,7 +10,7 @@ import ( "os" "github.com/kirsle/blog/core" - "github.com/kirsle/blog/core/jsondb" + "github.com/kirsle/blog/jsondb" ) // Build-time config constants. diff --git a/cmd/rophako-import/main.go b/cmd/rophako-import/main.go index 78061f6..650832e 100644 --- a/cmd/rophako-import/main.go +++ b/cmd/rophako-import/main.go @@ -16,7 +16,7 @@ import ( "time" "github.com/google/uuid" - "github.com/kirsle/blog/core/jsondb" + "github.com/kirsle/blog/jsondb" "github.com/kirsle/blog/core/models/comments" "github.com/kirsle/blog/core/models/posts" "github.com/kirsle/golog" diff --git a/core/admin.go b/core/admin.go index feda5c9..ad0b1b1 100644 --- a/core/admin.go +++ b/core/admin.go @@ -11,10 +11,10 @@ import ( "strings" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/caches/null" - "github.com/kirsle/blog/core/caches/redis" - "github.com/kirsle/blog/core/forms" - "github.com/kirsle/blog/core/models/settings" + "github.com/kirsle/blog/jsondb/caches/null" + "github.com/kirsle/blog/jsondb/caches/redis" + "github.com/kirsle/blog/core/internal/forms" + "github.com/kirsle/blog/core/internal/models/settings" "github.com/urfave/negroni" ) diff --git a/core/app.go b/core/app.go index f8f7386..68182e2 100644 --- a/core/app.go +++ b/core/app.go @@ -7,14 +7,14 @@ import ( "github.com/gorilla/mux" "github.com/gorilla/sessions" - "github.com/kirsle/blog/core/caches" - "github.com/kirsle/blog/core/caches/null" - "github.com/kirsle/blog/core/caches/redis" - "github.com/kirsle/blog/core/jsondb" - "github.com/kirsle/blog/core/models/comments" - "github.com/kirsle/blog/core/models/posts" - "github.com/kirsle/blog/core/models/settings" - "github.com/kirsle/blog/core/models/users" + "github.com/kirsle/blog/jsondb/caches" + "github.com/kirsle/blog/jsondb/caches/null" + "github.com/kirsle/blog/jsondb/caches/redis" + "github.com/kirsle/blog/jsondb" + "github.com/kirsle/blog/core/internal/models/comments" + "github.com/kirsle/blog/core/internal/models/posts" + "github.com/kirsle/blog/core/internal/models/settings" + "github.com/kirsle/blog/core/internal/models/users" "github.com/shurcooL/github_flavored_markdown/gfmstyle" "github.com/urfave/negroni" ) diff --git a/core/auth.go b/core/auth.go index 4ac67e1..e0babce 100644 --- a/core/auth.go +++ b/core/auth.go @@ -5,8 +5,8 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/forms" - "github.com/kirsle/blog/core/models/users" + "github.com/kirsle/blog/core/internal/forms" + "github.com/kirsle/blog/core/internal/models/users" ) // AuthRoutes attaches the auth routes to the app. diff --git a/core/blog.go b/core/blog.go index 94f2400..d3d8d17 100644 --- a/core/blog.go +++ b/core/blog.go @@ -13,10 +13,10 @@ import ( "github.com/gorilla/feeds" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/models/comments" - "github.com/kirsle/blog/core/models/posts" - "github.com/kirsle/blog/core/models/settings" - "github.com/kirsle/blog/core/models/users" + "github.com/kirsle/blog/core/internal/models/comments" + "github.com/kirsle/blog/core/internal/models/posts" + "github.com/kirsle/blog/core/internal/models/settings" + "github.com/kirsle/blog/core/internal/models/users" "github.com/urfave/negroni" ) diff --git a/core/comments.go b/core/comments.go index 710c87d..bfbae2e 100644 --- a/core/comments.go +++ b/core/comments.go @@ -11,8 +11,8 @@ import ( "github.com/google/uuid" "github.com/gorilla/mux" "github.com/gorilla/sessions" - "github.com/kirsle/blog/core/models/comments" - "github.com/kirsle/blog/core/models/users" + "github.com/kirsle/blog/core/internal/models/comments" + "github.com/kirsle/blog/core/internal/models/users" ) // CommentRoutes attaches the comment routes to the app. diff --git a/core/contact.go b/core/contact.go index f8b6f8a..f1716f3 100644 --- a/core/contact.go +++ b/core/contact.go @@ -9,8 +9,8 @@ import ( "time" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/forms" - "github.com/kirsle/blog/core/models/settings" + "github.com/kirsle/blog/core/internal/forms" + "github.com/kirsle/blog/core/internal/models/settings" ) // ContactRoutes attaches the contact URL to the app. diff --git a/core/initial-setup.go b/core/initial-setup.go index ee88843..43afda5 100644 --- a/core/initial-setup.go +++ b/core/initial-setup.go @@ -4,9 +4,9 @@ import ( "net/http" "github.com/gorilla/sessions" - "github.com/kirsle/blog/core/forms" - "github.com/kirsle/blog/core/models/settings" - "github.com/kirsle/blog/core/models/users" + "github.com/kirsle/blog/core/internal/forms" + "github.com/kirsle/blog/core/internal/models/settings" + "github.com/kirsle/blog/core/internal/models/users" ) // SetupHandler is the initial blog setup route. diff --git a/core/forms/auth.go b/core/internal/forms/auth.go similarity index 100% rename from core/forms/auth.go rename to core/internal/forms/auth.go diff --git a/core/forms/contact.go b/core/internal/forms/contact.go similarity index 100% rename from core/forms/contact.go rename to core/internal/forms/contact.go diff --git a/core/forms/forms.go b/core/internal/forms/forms.go similarity index 100% rename from core/forms/forms.go rename to core/internal/forms/forms.go diff --git a/core/forms/settings.go b/core/internal/forms/settings.go similarity index 100% rename from core/forms/settings.go rename to core/internal/forms/settings.go diff --git a/core/forms/setup.go b/core/internal/forms/setup.go similarity index 100% rename from core/forms/setup.go rename to core/internal/forms/setup.go diff --git a/core/models/comments/comments.go b/core/internal/models/comments/comments.go similarity index 99% rename from core/models/comments/comments.go rename to core/internal/models/comments/comments.go index 816b5ef..7e3345b 100644 --- a/core/models/comments/comments.go +++ b/core/internal/models/comments/comments.go @@ -11,7 +11,7 @@ import ( "time" "github.com/google/uuid" - "github.com/kirsle/blog/core/jsondb" + "github.com/kirsle/blog/jsondb" "github.com/kirsle/golog" ) diff --git a/core/models/comments/subscribers.go b/core/internal/models/comments/subscribers.go similarity index 100% rename from core/models/comments/subscribers.go rename to core/internal/models/comments/subscribers.go diff --git a/core/models/posts/index.go b/core/internal/models/posts/index.go similarity index 100% rename from core/models/posts/index.go rename to core/internal/models/posts/index.go diff --git a/core/models/posts/posts.go b/core/internal/models/posts/posts.go similarity index 99% rename from core/models/posts/posts.go rename to core/internal/models/posts/posts.go index f25d80f..2ce884e 100644 --- a/core/models/posts/posts.go +++ b/core/internal/models/posts/posts.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/kirsle/blog/core/jsondb" + "github.com/kirsle/blog/jsondb" "github.com/kirsle/golog" ) diff --git a/core/models/posts/sorting.go b/core/internal/models/posts/sorting.go similarity index 100% rename from core/models/posts/sorting.go rename to core/internal/models/posts/sorting.go diff --git a/core/models/settings/settings.go b/core/internal/models/settings/settings.go similarity index 98% rename from core/models/settings/settings.go rename to core/internal/models/settings/settings.go index d933ffd..9407c3f 100644 --- a/core/models/settings/settings.go +++ b/core/internal/models/settings/settings.go @@ -4,7 +4,7 @@ import ( "crypto/rand" "encoding/base64" - "github.com/kirsle/blog/core/jsondb" + "github.com/kirsle/blog/jsondb" ) // DB is a reference to the parent app's JsonDB object. diff --git a/core/models/users/users.go b/core/internal/models/users/users.go similarity index 99% rename from core/models/users/users.go rename to core/internal/models/users/users.go index ab74307..e125704 100644 --- a/core/models/users/users.go +++ b/core/internal/models/users/users.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/kirsle/blog/core/jsondb" + "github.com/kirsle/blog/jsondb" "golang.org/x/crypto/bcrypt" ) diff --git a/core/models/users/utils.go b/core/internal/models/users/utils.go similarity index 100% rename from core/models/users/utils.go rename to core/internal/models/users/utils.go diff --git a/core/mail.go b/core/mail.go index 7245fac..4ff5c2b 100644 --- a/core/mail.go +++ b/core/mail.go @@ -8,8 +8,8 @@ import ( "net/url" "strings" - "github.com/kirsle/blog/core/models/comments" - "github.com/kirsle/blog/core/models/settings" + "github.com/kirsle/blog/core/internal/models/comments" + "github.com/kirsle/blog/core/internal/models/settings" "github.com/microcosm-cc/bluemonday" gomail "gopkg.in/gomail.v2" ) diff --git a/core/middleware.go b/core/middleware.go index 0fc8d8f..db552c6 100644 --- a/core/middleware.go +++ b/core/middleware.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" "github.com/gorilla/sessions" - "github.com/kirsle/blog/core/models/users" + "github.com/kirsle/blog/core/internal/models/users" ) type key int diff --git a/core/templates.go b/core/templates.go index ff19298..e79c6e5 100644 --- a/core/templates.go +++ b/core/templates.go @@ -7,9 +7,9 @@ import ( "strings" "time" - "github.com/kirsle/blog/core/forms" - "github.com/kirsle/blog/core/models/settings" - "github.com/kirsle/blog/core/models/users" + "github.com/kirsle/blog/core/internal/forms" + "github.com/kirsle/blog/core/internal/models/settings" + "github.com/kirsle/blog/core/internal/models/users" ) // Vars is an interface to implement by the templates to pass their own custom diff --git a/core/jsondb/cache.go b/jsondb/cache.go similarity index 100% rename from core/jsondb/cache.go rename to jsondb/cache.go diff --git a/core/caches/caches.go b/jsondb/caches/caches.go similarity index 100% rename from core/caches/caches.go rename to jsondb/caches/caches.go diff --git a/core/caches/null/null.go b/jsondb/caches/null/null.go similarity index 100% rename from core/caches/null/null.go rename to jsondb/caches/null/null.go diff --git a/core/caches/redis/redis.go b/jsondb/caches/redis/redis.go similarity index 100% rename from core/caches/redis/redis.go rename to jsondb/caches/redis/redis.go diff --git a/core/jsondb/jsondb.go b/jsondb/jsondb.go similarity index 99% rename from core/jsondb/jsondb.go rename to jsondb/jsondb.go index d74a435..d5712d4 100644 --- a/core/jsondb/jsondb.go +++ b/jsondb/jsondb.go @@ -12,7 +12,7 @@ import ( "sync" "time" - "github.com/kirsle/blog/core/caches" + "github.com/kirsle/blog/jsondb/caches" ) var ( diff --git a/core/jsondb/log.go b/jsondb/log.go similarity index 100% rename from core/jsondb/log.go rename to jsondb/log.go