diff --git a/main.go b/main.go index 05940f8..6d6e2dd 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ import ( "github.com/lbryio/ytsync/sdk" "github.com/spf13/cobra" + "github.com/lbryio/ytsync/manager" log "github.com/sirupsen/logrus" ) @@ -85,8 +86,8 @@ func ytSync(cmd *cobra.Command, args []string) { util.InitSlack(os.Getenv("SLACK_TOKEN"), os.Getenv("SLACK_CHANNEL"), hostname) } - if syncStatus != "" && !util.InSlice(syncStatus, SyncStatuses) { - log.Errorf("status must be one of the following: %v\n", SyncStatuses) + if syncStatus != "" && !util.InSlice(syncStatus, manager.SyncStatuses) { + log.Errorf("status must be one of the following: %v\n", manager.SyncStatuses) return } @@ -164,7 +165,7 @@ func ytSync(cmd *cobra.Command, args []string) { ApiToken: apiToken, HostName: hostname, } - sm := NewSyncManager( + sm := manager.NewSyncManager( stopOnError, maxTries, takeOverExistingChannel, @@ -190,7 +191,7 @@ func ytSync(cmd *cobra.Command, args []string) { ) err := sm.Start() if err != nil { - SendErrorToSlack(err.Error()) + manager.SendErrorToSlack(err.Error()) } - SendInfoToSlack("Syncing process terminated!") + manager.SendInfoToSlack("Syncing process terminated!") } diff --git a/count.go b/manager/count.go similarity index 97% rename from count.go rename to manager/count.go index a3c302f..5959df3 100644 --- a/count.go +++ b/manager/count.go @@ -1,4 +1,4 @@ -package main +package manager import ( "net/http" diff --git a/manager.go b/manager/manager.go similarity index 99% rename from manager.go rename to manager/manager.go index 3b4c048..8dd75ee 100644 --- a/manager.go +++ b/manager/manager.go @@ -1,4 +1,4 @@ -package main +package manager import ( "fmt" diff --git a/setup.go b/manager/setup.go similarity index 99% rename from setup.go rename to manager/setup.go index 46f0949..d8720a3 100644 --- a/setup.go +++ b/manager/setup.go @@ -1,4 +1,4 @@ -package main +package manager import ( "time" diff --git a/ytsync.go b/manager/ytsync.go similarity index 99% rename from ytsync.go rename to manager/ytsync.go index 36da714..0d79bbb 100644 --- a/ytsync.go +++ b/manager/ytsync.go @@ -1,4 +1,4 @@ -package main +package manager import ( "bufio"