Skip to content

Commit

Permalink
refactor: change mod name to best practice
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinanielsen committed Dec 21, 2023
1 parent 1180913 commit a0dfa64
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 40 deletions.
4 changes: 2 additions & 2 deletions database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"log"
"os"

"github.com/go-fast-cdn/models"
"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/models"
"github.com/kevinanielsen/go-fast-cdn/util"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
Expand Down
2 changes: 1 addition & 1 deletion database/doc.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database

import (
"github.com/go-fast-cdn/models"
"github.com/kevinanielsen/go-fast-cdn/models"
)

func AddDoc(fileName string, fileHashBuffer []byte) (string, bool) {
Expand Down
2 changes: 1 addition & 1 deletion database/image.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database

import (
"github.com/go-fast-cdn/models"
"github.com/kevinanielsen/go-fast-cdn/models"
)

func AddImage(fileName string, fileHashBuffer []byte) (string, bool) {
Expand Down
2 changes: 1 addition & 1 deletion database/migrate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "github.com/go-fast-cdn/models"
import "github.com/kevinanielsen/go-fast-cdn/models"

func Migrate() {
DB.AutoMigrate(&models.Image{}, &models.Doc{})
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/go-fast-cdn
module github.com/kevinanielsen/go-fast-cdn

go 1.21.2

Expand Down
4 changes: 2 additions & 2 deletions handlers/db/handleDropDB.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/models"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/models"
)

func HandleDropDB(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions handlers/docs/handleAllDocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/models"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/models"
)

func HandleAllDocs(c *gin.Context) {
Expand Down
7 changes: 4 additions & 3 deletions handlers/docs/handleDocDelete.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"net/http"

"fmt"
"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/util"
"os"

"github.com/gin-gonic/gin"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func HandleDocDelete(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions handlers/docs/handleDocUpload.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"path/filepath"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func HandleDocUpload(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions handlers/docs/handleDocsRename.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"path/filepath"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func HandleDocsRename(c *gin.Context) {
Expand Down
2 changes: 1 addition & 1 deletion handlers/getSizeHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func GetSizeHandler(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions handlers/image/handleAllImages.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/models"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/models"
)

func HandleAllImages(c *gin.Context) {
Expand Down
9 changes: 5 additions & 4 deletions handlers/image/handleImageDelete.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package handlers

import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/util"
"net/http"
"os"

"github.com/gin-gonic/gin"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func HandleImageDelete(c *gin.Context) {
Expand All @@ -22,7 +23,7 @@ func HandleImageDelete(c *gin.Context) {
err := os.Remove(filePath)
if success && err == nil {
c.JSON(http.StatusOK, gin.H{
"message": "Image deleted successfuly",
"message": "Image deleted successfully",
"fileName": deletedFileName,
})
} else {
Expand Down
4 changes: 2 additions & 2 deletions handlers/image/handleImageRename.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"path/filepath"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func HandleImageRename(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions handlers/image/handleImageUpload.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"path/filepath"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/database"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func HandleImageUpload(c *gin.Context) {
Expand Down
2 changes: 1 addition & 1 deletion initializers/createFolders.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func CreateFolders() {
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"os"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/database"
ini "github.com/go-fast-cdn/initializers"
"github.com/go-fast-cdn/router"
"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/database"
ini "github.com/kevinanielsen/go-fast-cdn/initializers"
"github.com/kevinanielsen/go-fast-cdn/router"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func init() {
Expand Down
10 changes: 5 additions & 5 deletions router/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"net/http"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/handlers"
dbHandlers "github.com/go-fast-cdn/handlers/db"
dHandlers "github.com/go-fast-cdn/handlers/docs"
iHandlers "github.com/go-fast-cdn/handlers/image"
"github.com/go-fast-cdn/util"
"github.com/kevinanielsen/go-fast-cdn/handlers"
dbHandlers "github.com/kevinanielsen/go-fast-cdn/handlers/db"
dHandlers "github.com/kevinanielsen/go-fast-cdn/handlers/docs"
iHandlers "github.com/kevinanielsen/go-fast-cdn/handlers/image"
"github.com/kevinanielsen/go-fast-cdn/util"
)

func AddApiRoutes(r *gin.Engine) {
Expand Down
4 changes: 2 additions & 2 deletions router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"

"github.com/gin-gonic/gin"
"github.com/go-fast-cdn/middleware"
"github.com/go-fast-cdn/ui"
"github.com/kevinanielsen/go-fast-cdn/middleware"
"github.com/kevinanielsen/go-fast-cdn/ui"
)

func Router() {
Expand Down

0 comments on commit a0dfa64

Please sign in to comment.