Move package from internal to src
This commit is contained in:
parent
517a2ee86b
commit
9b938ccff3
28
blog.go
28
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"
|
||||
|
|
|
@ -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.
|
||||
|
|
10
pages.go
10
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.
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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.
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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.
|
|
@ -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.
|
|
@ -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)
|
|
@ -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) {
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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"
|
||||
)
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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"
|
|
@ -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"
|
||||
)
|
|
@ -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"
|
||||
)
|
|
@ -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.
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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"
|
|
@ -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"
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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.
|
|
@ -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"
|
|
@ -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.
|
|
@ -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"
|
|
@ -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"
|
|
@ -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"
|
||||
)
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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
|
|
@ -7,7 +7,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/kirsle/blog/internal/log"
|
||||
"github.com/kirsle/blog/src/log"
|
||||
)
|
||||
|
||||
// Blog configuration bindings.
|
|
@ -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"
|
||||
)
|
|
@ -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.
|
|
@ -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.
|
Loading…
Reference in New Issue
Block a user