restructure

This commit is contained in:
jjohnstondev 2023-01-07 21:22:54 -08:00
parent d5a2e1b096
commit 22b8b18c4c
7 changed files with 14 additions and 23 deletions

View File

@ -1,4 +1,4 @@
package authmanager package auth
import ( import (
"encoding/json" "encoding/json"
@ -9,8 +9,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"gospt/config" "gospt/internal/config"
"gospt/ctx" "gospt/internal/ctx"
"github.com/zmb3/spotify/v2" "github.com/zmb3/spotify/v2"
spotifyauth "github.com/zmb3/spotify/v2/auth" spotifyauth "github.com/zmb3/spotify/v2/auth"

View File

@ -11,7 +11,7 @@ import (
"strings" "strings"
"time" "time"
"gospt/ctx" "gospt/internal/ctx"
"github.com/zmb3/spotify/v2" "github.com/zmb3/spotify/v2"
) )

View File

@ -3,9 +3,9 @@ package runner
import ( import (
"fmt" "fmt"
"gospt/commands" "gospt/internal/commands"
"gospt/ctx" "gospt/internal/ctx"
"gospt/tui" "gospt/internal/tui"
"github.com/zmb3/spotify/v2" "github.com/zmb3/spotify/v2"
) )

View File

@ -5,8 +5,8 @@ import (
"os" "os"
"time" "time"
"gospt/commands" "gospt/internal/commands"
"gospt/ctx" "gospt/internal/ctx"
"github.com/charmbracelet/bubbles/list" "github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea" tea "github.com/charmbracelet/bubbletea"

19
main.go
View File

@ -7,19 +7,10 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"gospt/authmanager" "gospt/internal/auth"
"gospt/config" "gospt/internal/config"
"gospt/ctx" "gospt/internal/ctx"
"gospt/runner" "gospt/internal/runner"
"github.com/zmb3/spotify/v2"
spotifyauth "github.com/zmb3/spotify/v2/auth"
)
var (
auth *spotifyauth.Authenticator
ch = make(chan *spotify.Client)
state = "abc123"
) )
func init() { func init() {
@ -32,7 +23,7 @@ func main() {
var err error var err error
log.New(os.Stdout, "LOG:", 0) log.New(os.Stdout, "LOG:", 0)
ctx := ctx.NewContext(context.Background()) ctx := ctx.NewContext(context.Background())
client, err := authmanager.GetClient(ctx) client, err := auth.GetClient(ctx)
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error())
} }