Skip to content

Commit c57e963

Browse files
CaixetadevWallysFerreirakevinanielsen
authored
refactor: change folder name (#118)
* refactor: change folder name * refactor: page structure * fix: adding the right module path * feat: upload multiple files (#116) * feat: add property 'multiple' to file input * feat: sends multiple documents or images to api * fix: show icon for each file being uploaded * fix: refresh page after uploading all files * chore: add semicolons * fix: cards overflow * chore: add EOF * fix: prevent file name overflow in card Co-authored-by: Kevin Nielsen <keveran@gmail.com> * chore: fix indentation --------- Co-authored-by: Kevin Nielsen <keveran@gmail.com> * feat: support for more OS (#117) * feat: add support for txt files (#120) * docs: fix readme link to goreportcard * chore: fix typos across files (#121) * Update handleImageResize.go * fix: successfully typo * refactor: rename folder * refactor: remove folder backend * refactor: move to root * fix: paths * build: run go mod tidy --------- Co-authored-by: Wallys Ferreira <wallysfsilva@gmail.com> Co-authored-by: Kevin Nielsen <keveran@gmail.com> Co-authored-by: Kevin Nielsen <kevinanielsen@outlook.com>
1 parent e8e97aa commit c57e963

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+156
-133
lines changed

Makefile

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
BINARY_NAME=go-fast-cdn
2+
OS_NAME := $(shell uname -s | tr A-Z a-z)
23

34
prep:
45
go mod tidy
@@ -11,12 +12,16 @@ build_ui:
1112
pnpm --dir ./ui build
1213

1314
build_bin:
14-
GOARCH=amd64 GOOS=darwin CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-darwin
15-
CC="x86_64-linux-musl-gcc" GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-linux
16-
CC="x86_64-w64-mingw32-gcc" GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-windows
15+
GOARCH=amd64 GOOS=darwin CGO_ENABLED=0 go build -o ./bin/${BINARY_NAME}-darwin ./cmd/
16+
CC="x86_64-linux-musl-gcc" GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o ./bin/${BINARY_NAME}-linux ./cmd/
17+
CC="x86_64-w64-mingw32-gcc" GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -o ./bin/${BINARY_NAME}-windows ./cmd/
1718

1819
run: build
19-
bin/${BINARY_NAME}-darwin
20+
ifeq ($(OS_NAME),)
21+
bin/${BINARY_NAME}-windows
22+
else
23+
bin/${BINARY_NAME}-${OS_NAME}
24+
endif
2025

2126
clean:
2227
go clean

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
</a>
55
<a href="https://github.com/kevinanielsen/go-fast-cdn/actions/workflows/release.yml/" target="_blank" rel="noopener">
66
<img src="https://github.com/kevinanielsen/go-fast-cdn/actions/workflows/release.yml/badge.svg?branch=main" />
7-
<img src="https://goreportcard.com/badge/github.com/kevinanielsen/go-fast-cdn">
7+
</a>
8+
<a href="https://goreportcard.com/report/github.com/kevinanielsen/go-fast-cdn" target="_blank" rel="noopener">
9+
<img src="https://goreportcard.com/badge/github.com/kevinanielsen/go-fast-cdn" />
810
</a>
911
</p>
1012

main.go cmd/main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"os"
66

77
"github.com/gin-gonic/gin"
8-
"github.com/kevinanielsen/go-fast-cdn/src/database"
9-
ini "github.com/kevinanielsen/go-fast-cdn/src/initializers"
10-
"github.com/kevinanielsen/go-fast-cdn/src/router"
11-
"github.com/kevinanielsen/go-fast-cdn/src/util"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
9+
ini "github.com/kevinanielsen/go-fast-cdn/internal/initializers"
10+
"github.com/kevinanielsen/go-fast-cdn/internal/router"
11+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1212
)
1313

1414
func init() {

main_test.go cmd/main_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"testing"
66

77
"github.com/gin-gonic/gin"
8-
"github.com/kevinanielsen/go-fast-cdn/src/database"
9-
ini "github.com/kevinanielsen/go-fast-cdn/src/initializers"
10-
"github.com/kevinanielsen/go-fast-cdn/src/util"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
9+
ini "github.com/kevinanielsen/go-fast-cdn/internal/initializers"
10+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1111
)
1212

1313
func setup() {

go.mod

-4
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,17 @@ require (
2626
github.com/go-playground/universal-translator v0.18.1 // indirect
2727
github.com/go-playground/validator/v10 v10.16.0 // indirect
2828
github.com/goccy/go-json v0.10.2 // indirect
29-
github.com/google/go-cmp v0.5.9 // indirect
3029
github.com/jinzhu/inflection v1.0.0 // indirect
3130
github.com/jinzhu/now v1.1.5 // indirect
3231
github.com/json-iterator/go v1.1.12 // indirect
3332
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
34-
github.com/kr/pretty v0.3.0 // indirect
3533
github.com/leodido/go-urn v1.2.4 // indirect
3634
github.com/mattn/go-isatty v0.0.20 // indirect
3735
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3836
github.com/modern-go/reflect2 v1.0.2 // indirect
3937
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
4038
github.com/pmezard/go-difflib v1.0.0 // indirect
4139
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
42-
github.com/rogpeppe/go-internal v1.11.0 // indirect
4340
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
4441
github.com/ugorji/go/codec v1.2.12 // indirect
4542
golang.org/x/arch v0.6.0 // indirect
@@ -49,7 +46,6 @@ require (
4946
golang.org/x/sys v0.15.0 // indirect
5047
golang.org/x/text v0.14.0 // indirect
5148
google.golang.org/protobuf v1.31.0 // indirect
52-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
5349
gopkg.in/yaml.v3 v3.0.1 // indirect
5450
modernc.org/libc v1.38.0 // indirect
5551
modernc.org/mathutil v1.6.0 // indirect

go.sum

+4-18
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc
1717
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
1818
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
1919
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
20-
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
2120
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2221
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2322
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -47,9 +46,8 @@ github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QX
4746
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
4847
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
4948
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
49+
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
5050
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
51-
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
52-
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
5351
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
5452
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
5553
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
@@ -69,14 +67,6 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02
6967
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
7068
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
7169
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
72-
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
73-
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
74-
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
75-
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
76-
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
77-
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
78-
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
79-
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
8070
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
8171
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
8272
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
@@ -96,9 +86,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
9686
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9787
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
9888
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
99-
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
100-
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
101-
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
10289
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
10390
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
10491
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
@@ -144,14 +131,13 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
144131
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
145132
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
146133
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
134+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
135+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
147136
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
148137
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
149138
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
139+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
150140
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
151-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
152-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
153-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
154-
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
155141
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
156142
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
157143
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

src/database/database.go internal/database/database.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"os"
77

88
"github.com/glebarez/sqlite"
9-
"github.com/kevinanielsen/go-fast-cdn/src/models"
10-
"github.com/kevinanielsen/go-fast-cdn/src/util"
9+
"github.com/kevinanielsen/go-fast-cdn/internal/models"
10+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1111
"gorm.io/gorm"
1212
)
1313

src/database/doc.go internal/database/doc.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package database
22

3-
import (
4-
"github.com/kevinanielsen/go-fast-cdn/src/models"
5-
)
3+
import "github.com/kevinanielsen/go-fast-cdn/internal/models"
64

75
func AddDoc(fileName string, fileHashBuffer []byte) (string, bool) {
86
var doc models.Doc

src/database/image.go internal/database/image.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package database
22

3-
import (
4-
"github.com/kevinanielsen/go-fast-cdn/src/models"
5-
)
3+
import "github.com/kevinanielsen/go-fast-cdn/internal/models"
64

75
func AddImage(fileName string, fileHashBuffer []byte) (string, bool) {
86
var image models.Image

src/database/migrate.go internal/database/migrate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package database
22

3-
import "github.com/kevinanielsen/go-fast-cdn/src/models"
3+
import "github.com/kevinanielsen/go-fast-cdn/internal/models"
44

55
// Migrate runs database migrations for all model structs using
66
// the global DB instance. This would typically be called on app startup.

src/handlers/db/handleDropDB.go internal/handlers/db/handleDropDB.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"os"
66

77
"github.com/gin-gonic/gin"
8-
"github.com/kevinanielsen/go-fast-cdn/src/database"
9-
"github.com/kevinanielsen/go-fast-cdn/src/models"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
9+
"github.com/kevinanielsen/go-fast-cdn/internal/models"
1010
)
1111

1212
func HandleDropDB(c *gin.Context) {

src/handlers/docs/handleAllDocs.go internal/handlers/docs/handleAllDocs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"net/http"
55

66
"github.com/gin-gonic/gin"
7-
"github.com/kevinanielsen/go-fast-cdn/src/database"
8-
"github.com/kevinanielsen/go-fast-cdn/src/models"
7+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/models"
99
)
1010

1111
func HandleAllDocs(c *gin.Context) {

src/handlers/docs/handleDocDelete.go internal/handlers/docs/handleDocDelete.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"net/http"
55

66
"github.com/gin-gonic/gin"
7-
"github.com/kevinanielsen/go-fast-cdn/src/database"
8-
"github.com/kevinanielsen/go-fast-cdn/src/util"
7+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
99
)
1010

1111
func HandleDocDelete(c *gin.Context) {
@@ -33,7 +33,7 @@ func HandleDocDelete(c *gin.Context) {
3333
}
3434

3535
c.JSON(http.StatusOK, gin.H{
36-
"message": "Document deleted successfuly",
36+
"message": "Document deleted successfully",
3737
"fileName": deletedFileName,
3838
})
3939
}

src/handlers/docs/handleDocMetadata.go internal/handlers/docs/handleDocMetadata.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import (
77
"os"
88
"path/filepath"
99

10-
"github.com/kevinanielsen/go-fast-cdn/src/util"
11-
1210
"github.com/gin-gonic/gin"
11+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1312
)
1413

1514
func HandleDocMetadata(c *gin.Context) {

src/handlers/docs/handleDocMetadata_test.go internal/handlers/docs/handleDocMetadata_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import (
88
"path/filepath"
99
"testing"
1010

11-
"github.com/kevinanielsen/go-fast-cdn/src/util"
12-
1311
"github.com/gin-gonic/gin"
1412
"github.com/google/uuid"
13+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1514
"github.com/stretchr/testify/require"
1615
)
1716

src/handlers/docs/handleDocUpload.go internal/handlers/docs/handleDocUpload.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"path/filepath"
77

88
"github.com/gin-gonic/gin"
9-
"github.com/kevinanielsen/go-fast-cdn/src/database"
10-
"github.com/kevinanielsen/go-fast-cdn/src/util"
9+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
10+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1111
)
1212

1313
func HandleDocUpload(c *gin.Context) {
@@ -35,8 +35,9 @@ func HandleDocUpload(c *gin.Context) {
3535
fileType := http.DetectContentType(fileBuffer)
3636

3737
allowedMimeTypes := map[string]bool{
38-
"text/plain": true,
39-
"application/msword": true,
38+
"text/plain": true,
39+
"text/plain; charset=utf-8": true,
40+
"application/msword": true,
4041
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": true,
4142
"application/vnd.openxmlformats-officedocument.presentationml.presentation": true,
4243
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": true,

src/handlers/docs/handleDocsRename.go internal/handlers/docs/handleDocsRename.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"net/http"
55

66
"github.com/gin-gonic/gin"
7-
"github.com/kevinanielsen/go-fast-cdn/src/database"
8-
"github.com/kevinanielsen/go-fast-cdn/src/util"
9-
"github.com/kevinanielsen/go-fast-cdn/src/validations"
7+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
9+
"github.com/kevinanielsen/go-fast-cdn/internal/validations"
1010
)
1111

1212
func HandleDocsRename(c *gin.Context) {

src/handlers/getSizeHandler.go internal/handlers/getSizeHandler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"path/filepath"
88

99
"github.com/gin-gonic/gin"
10-
"github.com/kevinanielsen/go-fast-cdn/src/util"
10+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1111
)
1212

1313
func GetSizeHandler(c *gin.Context) {

src/handlers/image/handleAllImages.go internal/handlers/image/handleAllImages.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"net/http"
55

66
"github.com/gin-gonic/gin"
7-
"github.com/kevinanielsen/go-fast-cdn/src/database"
8-
"github.com/kevinanielsen/go-fast-cdn/src/models"
7+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/models"
99
)
1010

1111
func HandleAllImages(c *gin.Context) {

src/handlers/image/handleImageDelete.go internal/handlers/image/handleImageDelete.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"net/http"
55

66
"github.com/gin-gonic/gin"
7-
"github.com/kevinanielsen/go-fast-cdn/src/database"
8-
"github.com/kevinanielsen/go-fast-cdn/src/util"
7+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
99
)
1010

1111
func HandleImageDelete(c *gin.Context) {

src/handlers/image/handleImageMetadata.go internal/handlers/image/handleImageMetadata.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"path/filepath"
1010

1111
"github.com/gin-gonic/gin"
12-
"github.com/kevinanielsen/go-fast-cdn/src/util"
12+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1313
)
1414

1515
func HandleImageMetadata(c *gin.Context) {

src/handlers/image/handleImageMetadata_test.go internal/handlers/image/handleImageMetadata_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"testing"
1414

1515
"github.com/gin-gonic/gin"
16-
"github.com/kevinanielsen/go-fast-cdn/src/util"
16+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1717
"github.com/stretchr/testify/require"
1818
)
1919

src/handlers/image/handleImageRename.go internal/handlers/image/handleImageRename.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"net/http"
55

66
"github.com/gin-gonic/gin"
7-
"github.com/kevinanielsen/go-fast-cdn/src/database"
8-
"github.com/kevinanielsen/go-fast-cdn/src/util"
9-
"github.com/kevinanielsen/go-fast-cdn/src/validations"
7+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
8+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
9+
"github.com/kevinanielsen/go-fast-cdn/internal/validations"
1010
)
1111

1212
func HandleImageRename(c *gin.Context) {

src/handlers/image/handleImageResize.go internal/handlers/image/handleImageResize.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/anthonynsimon/bild/imgio"
1010
"github.com/anthonynsimon/bild/transform"
1111
"github.com/gin-gonic/gin"
12-
"github.com/kevinanielsen/go-fast-cdn/src/util"
12+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1313
)
1414

1515
// TODO: add logging package
@@ -20,7 +20,7 @@ func HandleImageResize(c *gin.Context) {
2020
Height int `json:"height" binding:"required"`
2121
}{}
2222
if e := c.BindJSON(&body); e != nil {
23-
// TODO: add shared error handling accross handler package
23+
// TODO: add shared error handling across handler package
2424
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
2525
"error": e.Error(),
2626
})

src/handlers/image/handleImageUpload.go internal/handlers/image/handleImageUpload.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"path/filepath"
77

88
"github.com/gin-gonic/gin"
9-
"github.com/kevinanielsen/go-fast-cdn/src/database"
10-
"github.com/kevinanielsen/go-fast-cdn/src/util"
9+
"github.com/kevinanielsen/go-fast-cdn/internal/database"
10+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
1111
)
1212

1313
func HandleImageUpload(c *gin.Context) {

src/initializers/createFolders.go internal/initializers/createFolders.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/kevinanielsen/go-fast-cdn/src/util"
7+
"github.com/kevinanielsen/go-fast-cdn/internal/util"
88
)
99

1010
func CreateFolders() {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)