From 01bbe952266df99676430db561f92e0d4fadcaca Mon Sep 17 00:00:00 2001 From: Mark Beamer Jr Date: Thu, 10 Jan 2019 21:02:26 -0500 Subject: [PATCH] upgraded to latest lbry.go reorg part 2 --- main.go | 11 ++++++----- count.go => manager/count.go | 2 +- manager.go => manager/manager.go | 2 +- setup.go => manager/setup.go | 2 +- ytsync.go => manager/ytsync.go | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) rename count.go => manager/count.go (97%) rename manager.go => manager/manager.go (99%) rename setup.go => manager/setup.go (99%) rename ytsync.go => manager/ytsync.go (99%) 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"