spotify

package
v0.0.0-...-99409e2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopePlaylistReadCollaborative Scope = "playlist-read-collaborative"
	ScopePlaylistModifyPublic            = "playlist-modify-public"
	ScopePlaylistReadPrivate             = "playlist-read-private"
	ScopePlaylistModifyPrivate           = "playlist-modify-private"
	ScopeUserReadPrivate                 = "user-read-private"
	ScopeUserReadEmail                   = "user-read-email"
	ScopeUserFollowRead                  = "user-follow-read"
	ScopeUserFollowModify                = "user-follow-modify"
)

Variables

This section is empty.

Functions

func PlaylistTrackIDs

func PlaylistTrackIDs(playlist *Playlist) []string

PlaylistTrackIDs returns all track IDs in a playlist, lexically sorted.

Types

type Album

type Album struct {
	ID           string            `json:"id"`
	Name         string            `json:"name"`
	ExternalURLs map[string]string `json:"external_urls"`
}

type Artist

type Artist struct {
	ID           string            `json:"id"`
	Name         string            `json:"name"`
	ExternalURLs map[string]string `json:"external_urls"`
}

type CachingClient

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

func NewCachingClient

func NewCachingClient(client *SpotifyClient) *CachingClient

func (*CachingClient) GetPlaylist

func (c *CachingClient) GetPlaylist(userID, playlistID string) (*Playlist, error)

func (*CachingClient) GetProfile

func (c *CachingClient) GetProfile(userID string) (*PublicProfile, error)

type NotFoundError

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

func (*NotFoundError) Error

func (n *NotFoundError) Error() string

type Playlist

type Playlist struct {
	ID             string            `json:"id"`
	Name           string            `json:"name"`
	Owner          *PublicProfile    `json:"owner"`
	SnapshotID     string            `json:"snapshot_id"`
	Collaborative  bool              `json:"collaborative"`
	ExternalURLs   map[string]string `json:"external_urls"`
	PlaylistTracks []*PlaylistTrack
	RawTracks      listPlaylistTracks `json:"tracks"`
}

type PlaylistTrack

type PlaylistTrack struct {
	Track   *Track         `json:"track"`
	AddedAt time.Time      `json:"added_at"`
	AddedBy *PublicProfile `json:"added_by"`
}

type PlaylistVisibility

type PlaylistVisibility int
const (
	PlaylistPrivate PlaylistVisibility = iota
	PlaylistPublic
	PlaylistCollaborative
)

type PrivateProfile

type PrivateProfile struct {
	ID          string `json:"id"`
	DisplayName string `json:"display_name,omitempty"`
	Email       string `json:"email,omitempty"`
	URI         string `json:"uri,omitempty"`
}

type PublicProfile

type PublicProfile struct {
	ID          string `json:"id"`
	DisplayName string `json:"display_name"`
}

type Scope

type Scope string

type SpotifyClient

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

func NewSpotifyClient

func NewSpotifyClient(accessToken string) *SpotifyClient

func (*SpotifyClient) CreatePlaylist

func (s *SpotifyClient) CreatePlaylist(userID, name string, visibility PlaylistVisibility) (*Playlist, error)

func (*SpotifyClient) FollowPlaylist

func (s *SpotifyClient) FollowPlaylist(ownerID, playlistID string, public bool) (*http.Response, error)

func (*SpotifyClient) GetMyProfile

func (s *SpotifyClient) GetMyProfile() (*PrivateProfile, error)

func (*SpotifyClient) GetPlaylist

func (s *SpotifyClient) GetPlaylist(userID, playlistID string) (*Playlist, error)

func (*SpotifyClient) GetProfile

func (s *SpotifyClient) GetProfile(userID string) (*PublicProfile, error)

func (*SpotifyClient) ListMyPlaylists

func (s *SpotifyClient) ListMyPlaylists() ([]*Playlist, error)

type Track

type Track struct {
	ID           string            `json:"id"`
	Name         string            `json:"name"`
	Arists       []*Artist         `json:"artists"`
	Album        *Album            `json:"album"`
	ExternalURLs map[string]string `json:"external_urls"`
	URI          string            `json:"uri"`
}

Jump to

Keyboard shortcuts

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