diff --git a/.gitignore b/.gitignore index eb6256b..704a057 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ **/userdata/* +examples +tests \ No newline at end of file diff --git a/cmd/gosimplenpm/conf.go b/cmd/gosimplenpm/conf.go index 8760932..0348268 100644 --- a/cmd/gosimplenpm/conf.go +++ b/cmd/gosimplenpm/conf.go @@ -2,7 +2,7 @@ package gosimplenpm import ( "fmt" - "gosimplenpm/config" + "gosimplenpm/internal/config" "os" "github.com/spf13/cobra" diff --git a/cmd/gosimplenpm/root.go b/cmd/gosimplenpm/root.go index 190dd94..25ba6c2 100644 --- a/cmd/gosimplenpm/root.go +++ b/cmd/gosimplenpm/root.go @@ -2,8 +2,8 @@ package gosimplenpm import ( "fmt" - "gosimplenpm/config" - "gosimplenpm/handler" + "gosimplenpm/internal/config" + "gosimplenpm/internal/handler" "os" "github.com/sirupsen/logrus" diff --git a/config/conf.go b/internal/config/conf.go similarity index 100% rename from config/conf.go rename to internal/config/conf.go diff --git a/handler/app.go b/internal/handler/app.go similarity index 95% rename from handler/app.go rename to internal/handler/app.go index 2879a8e..26e43ed 100644 --- a/handler/app.go +++ b/internal/handler/app.go @@ -1,8 +1,8 @@ package handler import ( - "gosimplenpm/config" - "gosimplenpm/middlewares" + "gosimplenpm/internal/config" + "gosimplenpm/internal/middlewares" "net/http" "time" diff --git a/handler/get.go b/internal/handler/get.go similarity index 92% rename from handler/get.go rename to internal/handler/get.go index 649f38c..925aa9e 100644 --- a/handler/get.go +++ b/internal/handler/get.go @@ -8,8 +8,8 @@ import ( "github.com/gorilla/mux" "github.com/sirupsen/logrus" - "gosimplenpm/config" - "gosimplenpm/storage" + "gosimplenpm/internal/config" + "gosimplenpm/internal/storage" ) func GetPackage(lg *logrus.Logger, cfg config.Config) http.HandlerFunc { diff --git a/internal/handler/get_test.go b/internal/handler/get_test.go new file mode 100644 index 0000000..abeebd1 --- /dev/null +++ b/internal/handler/get_test.go @@ -0,0 +1 @@ +package handler diff --git a/handler/notfound.go b/internal/handler/notfound.go similarity index 100% rename from handler/notfound.go rename to internal/handler/notfound.go diff --git a/handler/publish.go b/internal/handler/publish.go similarity index 97% rename from handler/publish.go rename to internal/handler/publish.go index f1626a1..27af380 100644 --- a/handler/publish.go +++ b/internal/handler/publish.go @@ -3,9 +3,9 @@ package handler import ( "encoding/json" "fmt" - "gosimplenpm/config" - "gosimplenpm/serviceidos" - "gosimplenpm/storage" + "gosimplenpm/internal/config" + "gosimplenpm/internal/serviceidos" + "gosimplenpm/internal/storage" "net/http" "net/url" "path" diff --git a/handler/tagdelete.go b/internal/handler/tagdelete.go similarity index 95% rename from handler/tagdelete.go rename to internal/handler/tagdelete.go index b1c2574..f5f06cd 100644 --- a/handler/tagdelete.go +++ b/internal/handler/tagdelete.go @@ -3,9 +3,9 @@ package handler import ( "encoding/json" "fmt" - "gosimplenpm/config" - "gosimplenpm/serviceidos" - "gosimplenpm/storage" + "gosimplenpm/internal/config" + "gosimplenpm/internal/serviceidos" + "gosimplenpm/internal/storage" "net/http" "net/url" "strconv" diff --git a/handler/tagget.go b/internal/handler/tagget.go similarity index 92% rename from handler/tagget.go rename to internal/handler/tagget.go index 5dacdf1..4957334 100644 --- a/handler/tagget.go +++ b/internal/handler/tagget.go @@ -3,9 +3,9 @@ package handler import ( "encoding/json" "fmt" - "gosimplenpm/config" - "gosimplenpm/serviceidos" - "gosimplenpm/storage" + "gosimplenpm/internal/config" + "gosimplenpm/internal/serviceidos" + "gosimplenpm/internal/storage" "net/http" "net/url" "strconv" diff --git a/handler/tagput.go b/internal/handler/tagput.go similarity index 95% rename from handler/tagput.go rename to internal/handler/tagput.go index 0f3aed8..a0fc17b 100644 --- a/handler/tagput.go +++ b/internal/handler/tagput.go @@ -3,9 +3,9 @@ package handler import ( "encoding/json" "fmt" - "gosimplenpm/config" - "gosimplenpm/serviceidos" - "gosimplenpm/storage" + "gosimplenpm/internal/config" + "gosimplenpm/internal/serviceidos" + "gosimplenpm/internal/storage" "io" "net/http" "net/url" diff --git a/handler/tar.go b/internal/handler/tar.go similarity index 95% rename from handler/tar.go rename to internal/handler/tar.go index d7c875b..00c3593 100644 --- a/handler/tar.go +++ b/internal/handler/tar.go @@ -2,8 +2,8 @@ package handler import ( "bytes" - "gosimplenpm/config" - "gosimplenpm/storage" + "gosimplenpm/internal/config" + "gosimplenpm/internal/storage" "io" "net/http" "net/url" diff --git a/middlewares/auth.go b/internal/middlewares/auth.go similarity index 95% rename from middlewares/auth.go rename to internal/middlewares/auth.go index cc3cf91..489003a 100644 --- a/middlewares/auth.go +++ b/internal/middlewares/auth.go @@ -1,7 +1,7 @@ package middlewares import ( - "gosimplenpm/config" + "gosimplenpm/internal/config" "net/http" "strings" ) diff --git a/middlewares/logRequest.go b/internal/middlewares/logRequest.go similarity index 100% rename from middlewares/logRequest.go rename to internal/middlewares/logRequest.go diff --git a/serviceidos/responseidos.go b/internal/serviceidos/responseidos.go similarity index 100% rename from serviceidos/responseidos.go rename to internal/serviceidos/responseidos.go diff --git a/storage/fs.go b/internal/storage/fs.go similarity index 99% rename from storage/fs.go rename to internal/storage/fs.go index 48bf365..4459285 100644 --- a/storage/fs.go +++ b/internal/storage/fs.go @@ -12,7 +12,7 @@ import ( "path" "strings" - "gosimplenpm/serviceidos" + "gosimplenpm/internal/serviceidos" "path/filepath" "github.com/sirupsen/logrus"