app

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigCacheFilePath = spotifydefault.DefaultConfigCacheFilePath

DefaultConfigCacheFilePath is the default path where auth tokens are cached on disk.

Functions

func LogoutFromDisk added in v1.1.0

func LogoutFromDisk(configCacheFilePath string)

LogoutFromDisk removes the cached Spotify auth tokens from disk without requiring an initialized App instance. Useful for logout when credentials may not be available. It never fails even if the user is not logged in.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cfg *AppConfig) (*App, error)

func (*App) AuthStatus added in v1.1.0

func (a *App) AuthStatus(ctx context.Context) error

AuthStatus prints the current authentication status to stdout and returns nil on success. Returns an *ExitCodeError with Code=2 if the user is not authenticated or tokens are invalid.

func (*App) GetPlaylist

func (a *App) GetPlaylist(ctx context.Context, playlistID string) error

func (*App) GetShow

func (a *App) GetShow(ctx context.Context, showID string) error

func (*App) Login added in v1.1.0

func (a *App) Login(ctx context.Context) error

func (*App) Logout added in v1.1.0

func (a *App) Logout(ctx context.Context)

func (*App) PlaylistFilter

func (a *App) PlaylistFilter(ctx context.Context, config *spotify.PlaylistFilterConfig) error

type AppConfig

type AppConfig struct {
	DevMode                bool
	SpotifyAppClientID     string `validate:"required"`
	SpotifyAppClientSecret string `validate:"required"`
	PublicAPIEndpoint      string `validate:"required"`
	ServerListenPort       uint16 `validate:"required"`
	ConfigCacheFilePath    string `validate:"required"`
}

type ExitCodeError added in v1.1.0

type ExitCodeError struct {
	Code int
	// contains filtered or unexported fields
}

ExitCodeError is an error that requests a specific process exit code. The error message was already printed to stdout before this error is returned, so callers should exit with Code without printing anything further.

func (*ExitCodeError) Error added in v1.1.0

func (e *ExitCodeError) Error() string

Directories

Path Synopsis
services

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL