Documentation ¶
Index ¶
- type AuthenticatedClient
- type SpotifyClient
- func (c *SpotifyClient) AddTracksToPlaylist(ctx context.Context, input entities.AddTracksToPlaylistClientInput) error
- func (c *SpotifyClient) CreatePlaylist(ctx context.Context, title string, description string) (*entities.CreatePlaylistOutput, error)
- func (c *SpotifyClient) CurrentSession() (*oauth2.Token, error)
- func (c *SpotifyClient) CurrentUser(ctx context.Context) (*spotify.PrivateUser, error)
- func (c *SpotifyClient) FindAllSongsByName(ctx context.Context, name []string, artist string) (*entities.FindAllSongsOutput, error)
- func (c *SpotifyClient) GetAuthURL(state string, genCodes oauth2util.GenerateOutput) string
- func (c *SpotifyClient) GetToken(ctx context.Context, r *http.Request, state string, ...) (*oauth2.Token, error)
- func (c *SpotifyClient) NewAPIClient(ctx context.Context, tok *oauth2.Token) *spotify.Client
- func (c *SpotifyClient) RefreshToken(ctx context.Context, tok *oauth2.Token) (*oauth2.Token, error)
- func (c *SpotifyClient) SetAuthenticatedClient(ch chan AuthenticatedClient)
- func (c *SpotifyClient) SetAuthenticatedClientFromInstance(client AuthenticatedClient)
- type SpotifyClientInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticatedClient ¶
type AuthenticatedClient struct {
spotify.Client
}
type SpotifyClient ¶
type SpotifyClient struct { Auth *spotifyauth.Authenticator AuthenticatedClient AuthenticatedClient Logger logger.LoggerInterface }
func (*SpotifyClient) AddTracksToPlaylist ¶
func (c *SpotifyClient) AddTracksToPlaylist( ctx context.Context, input entities.AddTracksToPlaylistClientInput, ) error
func (*SpotifyClient) CreatePlaylist ¶
func (c *SpotifyClient) CreatePlaylist( ctx context.Context, title string, description string, ) (*entities.CreatePlaylistOutput, error)
func (*SpotifyClient) CurrentSession ¶
func (c *SpotifyClient) CurrentSession() (*oauth2.Token, error)
func (*SpotifyClient) CurrentUser ¶
func (c *SpotifyClient) CurrentUser(ctx context.Context) (*spotify.PrivateUser, error)
func (*SpotifyClient) FindAllSongsByName ¶
func (c *SpotifyClient) FindAllSongsByName( ctx context.Context, name []string, artist string, ) (*entities.FindAllSongsOutput, error)
func (*SpotifyClient) GetAuthURL ¶
func (c *SpotifyClient) GetAuthURL(state string, genCodes oauth2util.GenerateOutput) string
func (*SpotifyClient) GetToken ¶
func (c *SpotifyClient) GetToken( ctx context.Context, r *http.Request, state string, genCodes oauth2util.GenerateOutput, ) (*oauth2.Token, error)
func (*SpotifyClient) NewAPIClient ¶
func (c *SpotifyClient) NewAPIClient(ctx context.Context, tok *oauth2.Token) *spotify.Client
func (*SpotifyClient) RefreshToken ¶
func (*SpotifyClient) SetAuthenticatedClient ¶
func (c *SpotifyClient) SetAuthenticatedClient(ch chan AuthenticatedClient)
func (*SpotifyClient) SetAuthenticatedClientFromInstance ¶
func (c *SpotifyClient) SetAuthenticatedClientFromInstance(client AuthenticatedClient)
type SpotifyClientInterface ¶
type SpotifyClientInterface interface { GetToken(ctx context.Context, r *http.Request, state string, genCodes oauth2util.GenerateOutput) (*oauth2.Token, error) GetAuthURL(state string, genCodes oauth2util.GenerateOutput) string NewAPIClient(ctx context.Context, tok *oauth2.Token) *spotify.Client SetAuthenticatedClient(ch chan AuthenticatedClient) SetAuthenticatedClientFromInstance(client AuthenticatedClient) CurrentUser(ctx context.Context) (*spotify.PrivateUser, error) CurrentSession() (*oauth2.Token, error) RefreshToken(ctx context.Context, tok *oauth2.Token) (*oauth2.Token, error) FindAllSongsByName(ctx context.Context, name []string, artist string) (*entities.FindAllSongsOutput, error) CreatePlaylist(ctx context.Context, title string, description string) (*entities.CreatePlaylistOutput, error) AddTracksToPlaylist(ctx context.Context, input entities.AddTracksToPlaylistClientInput) error }
func NewSpotifyClient ¶
func NewSpotifyClient( logger logger.LoggerInterface, redirURL string, clientID string, clientSecret string, ) SpotifyClientInterface
Click to show internal directories.
Click to hide internal directories.