diff --git a/authmanager/authmanager.go b/internal/auth/auth.go similarity index 98% rename from authmanager/authmanager.go rename to internal/auth/auth.go index a3d4d2f..bcdf6f9 100644 --- a/authmanager/authmanager.go +++ b/internal/auth/auth.go @@ -1,4 +1,4 @@ -package authmanager +package auth import ( "encoding/json" @@ -9,8 +9,8 @@ import ( "os" "path/filepath" - "gospt/config" - "gospt/ctx" + "gospt/internal/config" + "gospt/internal/ctx" "github.com/zmb3/spotify/v2" spotifyauth "github.com/zmb3/spotify/v2/auth" diff --git a/commands/commands.go b/internal/commands/commands.go similarity index 99% rename from commands/commands.go rename to internal/commands/commands.go index 7f877d3..187ff67 100644 --- a/commands/commands.go +++ b/internal/commands/commands.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "gospt/ctx" + "gospt/internal/ctx" "github.com/zmb3/spotify/v2" ) diff --git a/config/config.go b/internal/config/config.go similarity index 100% rename from config/config.go rename to internal/config/config.go diff --git a/ctx/context.go b/internal/ctx/context.go similarity index 100% rename from ctx/context.go rename to internal/ctx/context.go diff --git a/runner/runner.go b/internal/runner/runner.go similarity index 93% rename from runner/runner.go rename to internal/runner/runner.go index 25a2a44..48f2540 100644 --- a/runner/runner.go +++ b/internal/runner/runner.go @@ -3,9 +3,9 @@ package runner import ( "fmt" - "gospt/commands" - "gospt/ctx" - "gospt/tui" + "gospt/internal/commands" + "gospt/internal/ctx" + "gospt/internal/tui" "github.com/zmb3/spotify/v2" ) diff --git a/tui/list.go b/internal/tui/list.go similarity index 98% rename from tui/list.go rename to internal/tui/list.go index b3d4e72..9dbc054 100644 --- a/tui/list.go +++ b/internal/tui/list.go @@ -5,8 +5,8 @@ import ( "os" "time" - "gospt/commands" - "gospt/ctx" + "gospt/internal/commands" + "gospt/internal/ctx" "github.com/charmbracelet/bubbles/list" tea "github.com/charmbracelet/bubbletea" diff --git a/main.go b/main.go index 4891ccc..00a86a9 100644 --- a/main.go +++ b/main.go @@ -7,19 +7,10 @@ import ( "os" "path/filepath" - "gospt/authmanager" - "gospt/config" - "gospt/ctx" - "gospt/runner" - - "github.com/zmb3/spotify/v2" - spotifyauth "github.com/zmb3/spotify/v2/auth" -) - -var ( - auth *spotifyauth.Authenticator - ch = make(chan *spotify.Client) - state = "abc123" + "gospt/internal/auth" + "gospt/internal/config" + "gospt/internal/ctx" + "gospt/internal/runner" ) func init() { @@ -32,7 +23,7 @@ func main() { var err error log.New(os.Stdout, "LOG:", 0) ctx := ctx.NewContext(context.Background()) - client, err := authmanager.GetClient(ctx) + client, err := auth.GetClient(ctx) if err != nil { panic(err.Error()) }