Rename app->internal
This commit is contained in:
parent
ce85d6b77b
commit
ce03926ce6
@ -1,7 +1,7 @@
|
|||||||
package database
|
package database
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package database
|
package database
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/lib/pq"
|
"github.com/lib/pq"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"HttpPort": "8090"
|
"HttpPort": "8090"
|
||||||
},
|
},
|
||||||
"Template": {
|
"Template": {
|
||||||
"BaseTemplateName": "app/frontend/templates/base.html",
|
"BaseTemplateName": "internal/frontend/templates/base.html",
|
||||||
"ContentPath": "app/frontend/templates"
|
"ContentPath": "internal/frontend/templates"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,8 +1,8 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"GoWeb/app/models"
|
"GoWeb/internal/models"
|
||||||
"GoWeb/security"
|
"GoWeb/security"
|
||||||
"GoWeb/templating"
|
"GoWeb/templating"
|
||||||
"net/http"
|
"net/http"
|
@ -1,8 +1,8 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"GoWeb/app/models"
|
"GoWeb/internal/models"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
@ -1,8 +1,8 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
|
||||||
"GoWeb/database"
|
"GoWeb/database"
|
||||||
|
"GoWeb/internal"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"log/slog"
|
"log/slog"
|
@ -1,7 +1,7 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"log/slog"
|
"log/slog"
|
@ -1,8 +1,8 @@
|
|||||||
package routes
|
package routes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"GoWeb/app/controllers"
|
"GoWeb/internal/controllers"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
@ -1,9 +1,9 @@
|
|||||||
package routes
|
package routes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"GoWeb/app/controllers"
|
"GoWeb/internal/controllers"
|
||||||
"GoWeb/app/middleware"
|
"GoWeb/internal/middleware"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
8
main.go
8
main.go
@ -1,11 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
|
||||||
"GoWeb/app/models"
|
|
||||||
"GoWeb/app/routes"
|
|
||||||
"GoWeb/config"
|
"GoWeb/config"
|
||||||
"GoWeb/database"
|
"GoWeb/database"
|
||||||
|
"GoWeb/internal"
|
||||||
|
"GoWeb/internal/models"
|
||||||
|
"GoWeb/internal/routes"
|
||||||
"GoWeb/templating"
|
"GoWeb/templating"
|
||||||
"context"
|
"context"
|
||||||
"embed"
|
"embed"
|
||||||
@ -18,7 +18,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed app/frontend/templates app/frontend/static
|
//go:embed internal/frontend/templates internal/frontend/static
|
||||||
var res embed.FS
|
var res embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package templating
|
package templating
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/internal"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
@ -9,7 +9,7 @@ import (
|
|||||||
"net/http"
|
"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 {
|
func BuildPages(app *app.Deps) error {
|
||||||
basePath := app.Config.Template.BaseName
|
basePath := app.Config.Template.BaseName
|
||||||
|
Loading…
Reference in New Issue
Block a user