From 1a4f6ebaf24cfaff64fc0766562bf3fa571c4a20 Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Mon, 14 Aug 2023 18:16:42 -0400 Subject: [PATCH] Move utils and ytdl packages to pkg dir --- app/controllers/download.go | 4 ++-- app/controllers/home.go | 2 +- app/models/video.go | 2 +- app/views.go | 2 +- cmd/root.go | 6 +++--- {utils => pkg/utils}/badgerlogger.go | 0 {utils => pkg/utils}/logwriter.go | 0 {ytdl => pkg/ytdl}/cache/cache.go | 2 +- {ytdl => pkg/ytdl}/cmdbuilder.go | 2 +- {ytdl => pkg/ytdl}/cmdopts.go | 4 ++-- {ytdl => pkg/ytdl}/metadata/chapter.go | 0 {ytdl => pkg/ytdl}/metadata/comment.go | 0 {ytdl => pkg/ytdl}/metadata/format.go | 0 {ytdl => pkg/ytdl}/metadata/fragment.go | 0 {ytdl => pkg/ytdl}/metadata/hls.go | 0 {ytdl => pkg/ytdl}/metadata/metadata.go | 0 {ytdl => pkg/ytdl}/metadata/subtitle.go | 0 {ytdl => pkg/ytdl}/metadata/thumbnail.go | 0 {ytdl => pkg/ytdl}/ytdl.go | 4 ++-- 19 files changed, 14 insertions(+), 14 deletions(-) rename {utils => pkg/utils}/badgerlogger.go (100%) rename {utils => pkg/utils}/logwriter.go (100%) rename {ytdl => pkg/ytdl}/cache/cache.go (95%) rename {ytdl => pkg/ytdl}/cmdbuilder.go (94%) rename {ytdl => pkg/ytdl}/cmdopts.go (96%) rename {ytdl => pkg/ytdl}/metadata/chapter.go (100%) rename {ytdl => pkg/ytdl}/metadata/comment.go (100%) rename {ytdl => pkg/ytdl}/metadata/format.go (100%) rename {ytdl => pkg/ytdl}/metadata/fragment.go (100%) rename {ytdl => pkg/ytdl}/metadata/hls.go (100%) rename {ytdl => pkg/ytdl}/metadata/metadata.go (100%) rename {ytdl => pkg/ytdl}/metadata/subtitle.go (100%) rename {ytdl => pkg/ytdl}/metadata/thumbnail.go (100%) rename {ytdl => pkg/ytdl}/ytdl.go (96%) diff --git a/app/controllers/download.go b/app/controllers/download.go index 1d132df..fe6259e 100644 --- a/app/controllers/download.go +++ b/app/controllers/download.go @@ -14,8 +14,8 @@ import ( "go.fifitido.net/ytdl-web/pkg/httpx" "go.fifitido.net/ytdl-web/pkg/server" "go.fifitido.net/ytdl-web/pkg/view" - "go.fifitido.net/ytdl-web/ytdl" - "go.fifitido.net/ytdl-web/ytdl/metadata" + "go.fifitido.net/ytdl-web/pkg/ytdl" + "go.fifitido.net/ytdl-web/pkg/ytdl/metadata" "golang.org/x/exp/slog" ) diff --git a/app/controllers/home.go b/app/controllers/home.go index 90b3fca..e9392d5 100644 --- a/app/controllers/home.go +++ b/app/controllers/home.go @@ -9,8 +9,8 @@ import ( "go.fifitido.net/ytdl-web/pkg/htmx" "go.fifitido.net/ytdl-web/pkg/server" "go.fifitido.net/ytdl-web/pkg/view" + "go.fifitido.net/ytdl-web/pkg/ytdl" "go.fifitido.net/ytdl-web/version" - "go.fifitido.net/ytdl-web/ytdl" ) type HomeController struct { diff --git a/app/models/video.go b/app/models/video.go index 4231abe..4e44ce9 100644 --- a/app/models/video.go +++ b/app/models/video.go @@ -2,7 +2,7 @@ package models import ( "github.com/samber/lo" - "go.fifitido.net/ytdl-web/ytdl/metadata" + "go.fifitido.net/ytdl-web/pkg/ytdl/metadata" ) type Video struct { diff --git a/app/views.go b/app/views.go index f0f0a87..86c23b6 100644 --- a/app/views.go +++ b/app/views.go @@ -8,7 +8,7 @@ import ( "github.com/htfy96/reformism" "go.fifitido.net/ytdl-web/pkg/view/html" - "go.fifitido.net/ytdl-web/ytdl/metadata" + "go.fifitido.net/ytdl-web/pkg/ytdl/metadata" ) //go:embed views/* diff --git a/cmd/root.go b/cmd/root.go index e93d4ce..0c8daa3 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,9 +12,9 @@ import ( "go.fifitido.net/ytdl-web/app/controllers" "go.fifitido.net/ytdl-web/config" "go.fifitido.net/ytdl-web/pkg/server" - "go.fifitido.net/ytdl-web/utils" - "go.fifitido.net/ytdl-web/ytdl" - "go.fifitido.net/ytdl-web/ytdl/cache" + "go.fifitido.net/ytdl-web/pkg/utils" + "go.fifitido.net/ytdl-web/pkg/ytdl" + "go.fifitido.net/ytdl-web/pkg/ytdl/cache" "golang.org/x/exp/slog" ) diff --git a/utils/badgerlogger.go b/pkg/utils/badgerlogger.go similarity index 100% rename from utils/badgerlogger.go rename to pkg/utils/badgerlogger.go diff --git a/utils/logwriter.go b/pkg/utils/logwriter.go similarity index 100% rename from utils/logwriter.go rename to pkg/utils/logwriter.go diff --git a/ytdl/cache/cache.go b/pkg/ytdl/cache/cache.go similarity index 95% rename from ytdl/cache/cache.go rename to pkg/ytdl/cache/cache.go index ff125c7..fbb3cae 100644 --- a/ytdl/cache/cache.go +++ b/pkg/ytdl/cache/cache.go @@ -5,7 +5,7 @@ import ( "time" "github.com/dgraph-io/badger/v2" - "go.fifitido.net/ytdl-web/ytdl/metadata" + "go.fifitido.net/ytdl-web/pkg/ytdl/metadata" ) type MetadataCache interface { diff --git a/ytdl/cmdbuilder.go b/pkg/ytdl/cmdbuilder.go similarity index 94% rename from ytdl/cmdbuilder.go rename to pkg/ytdl/cmdbuilder.go index 0cd000e..4fddc2e 100644 --- a/ytdl/cmdbuilder.go +++ b/pkg/ytdl/cmdbuilder.go @@ -5,7 +5,7 @@ import ( "encoding/json" "os/exec" - "go.fifitido.net/ytdl-web/ytdl/metadata" + "go.fifitido.net/ytdl-web/pkg/ytdl/metadata" ) func Exec(binary, url string, options ...Option) error { diff --git a/ytdl/cmdopts.go b/pkg/ytdl/cmdopts.go similarity index 96% rename from ytdl/cmdopts.go rename to pkg/ytdl/cmdopts.go index 314f7ac..436cbda 100644 --- a/ytdl/cmdopts.go +++ b/pkg/ytdl/cmdopts.go @@ -7,8 +7,8 @@ import ( "io" "strings" - "go.fifitido.net/ytdl-web/utils" - "go.fifitido.net/ytdl-web/ytdl/metadata" + "go.fifitido.net/ytdl-web/pkg/utils" + "go.fifitido.net/ytdl-web/pkg/ytdl/metadata" "golang.org/x/exp/slog" ) diff --git a/ytdl/metadata/chapter.go b/pkg/ytdl/metadata/chapter.go similarity index 100% rename from ytdl/metadata/chapter.go rename to pkg/ytdl/metadata/chapter.go diff --git a/ytdl/metadata/comment.go b/pkg/ytdl/metadata/comment.go similarity index 100% rename from ytdl/metadata/comment.go rename to pkg/ytdl/metadata/comment.go diff --git a/ytdl/metadata/format.go b/pkg/ytdl/metadata/format.go similarity index 100% rename from ytdl/metadata/format.go rename to pkg/ytdl/metadata/format.go diff --git a/ytdl/metadata/fragment.go b/pkg/ytdl/metadata/fragment.go similarity index 100% rename from ytdl/metadata/fragment.go rename to pkg/ytdl/metadata/fragment.go diff --git a/ytdl/metadata/hls.go b/pkg/ytdl/metadata/hls.go similarity index 100% rename from ytdl/metadata/hls.go rename to pkg/ytdl/metadata/hls.go diff --git a/ytdl/metadata/metadata.go b/pkg/ytdl/metadata/metadata.go similarity index 100% rename from ytdl/metadata/metadata.go rename to pkg/ytdl/metadata/metadata.go diff --git a/ytdl/metadata/subtitle.go b/pkg/ytdl/metadata/subtitle.go similarity index 100% rename from ytdl/metadata/subtitle.go rename to pkg/ytdl/metadata/subtitle.go diff --git a/ytdl/metadata/thumbnail.go b/pkg/ytdl/metadata/thumbnail.go similarity index 100% rename from ytdl/metadata/thumbnail.go rename to pkg/ytdl/metadata/thumbnail.go diff --git a/ytdl/ytdl.go b/pkg/ytdl/ytdl.go similarity index 96% rename from ytdl/ytdl.go rename to pkg/ytdl/ytdl.go index 04b4806..0d3653d 100644 --- a/ytdl/ytdl.go +++ b/pkg/ytdl/ytdl.go @@ -7,8 +7,8 @@ import ( "strings" "go.fifitido.net/ytdl-web/config" - "go.fifitido.net/ytdl-web/ytdl/cache" - "go.fifitido.net/ytdl-web/ytdl/metadata" + "go.fifitido.net/ytdl-web/pkg/ytdl/cache" + "go.fifitido.net/ytdl-web/pkg/ytdl/metadata" "golang.org/x/exp/slog" )