spotify

package
v0.0.0-...-3dba2d3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndpointAddTracksToPlaylist

func EndpointAddTracksToPlaylist(uid, pid string) string

func EndpointBrowseCategories

func EndpointBrowseCategories() string

func EndpointBrowseFeaturedPlaylists

func EndpointBrowseFeaturedPlaylists() string

func EndpointBrowseNewReleases

func EndpointBrowseNewReleases() string

func EndpointChangePlaylistDetails

func EndpointChangePlaylistDetails(uid, pid string) string

func EndpointContainsAlbums

func EndpointContainsAlbums(ids []string) string

func EndpointCreatePlaylist

func EndpointCreatePlaylist(uid string) string

func EndpointDeleteAlbums

func EndpointDeleteAlbums(ids []string) string

func EndpointDeleteTracksFromPlaylist

func EndpointDeleteTracksFromPlaylist(uid, pid string) string

func EndpointFollowArtists

func EndpointFollowArtists(ids []string, typ string) string

func EndpointFollowPlaylist

func EndpointFollowPlaylist(uid, pid string) string

func EndpointFollowsArtists

func EndpointFollowsArtists(ids []string, typ string) string

func EndpointGetAlbum

func EndpointGetAlbum(id string) string

func EndpointGetAlbumTracks

func EndpointGetAlbumTracks(id string) string

func EndpointGetAlbums

func EndpointGetAlbums(ids []string) string

func EndpointGetArtist

func EndpointGetArtist(id string) string

func EndpointGetArtistAlbums

func EndpointGetArtistAlbums(id string) string

func EndpointGetArtistTopTracks

func EndpointGetArtistTopTracks(id string) string

func EndpointGetArtists

func EndpointGetArtists(ids []string) string

func EndpointGetAudioAnalysis

func EndpointGetAudioAnalysis(sid string) string

func EndpointGetAudioFeature

func EndpointGetAudioFeature(sid string) string

func EndpointGetAudioFeatures

func EndpointGetAudioFeatures(sids []string) string

func EndpointGetCategory

func EndpointGetCategory(id string) string

func EndpointGetCategoryPlaylists

func EndpointGetCategoryPlaylists(id string) string

func EndpointGetFollowedArtists

func EndpointGetFollowedArtists() string

func EndpointGetPlaylistTracks

func EndpointGetPlaylistTracks(uid, pid string) string

func EndpointGetRecommendations

func EndpointGetRecommendations(args ...string) string

func EndpointGetRelatedArtists

func EndpointGetRelatedArtists(id string) string

func EndpointGetSavedAlbums

func EndpointGetSavedAlbums() string

func EndpointGetSavedTracks

func EndpointGetSavedTracks() string

func EndpointGetTopArtistOrTrack

func EndpointGetTopArtistOrTrack(typ string) string

func EndpointGetTrack

func EndpointGetTrack(sid string) string

func EndpointGetTracks

func EndpointGetTracks(sids []string) string

func EndpointGetUser

func EndpointGetUser(uid string) string

func EndpointGetUserPlaylist

func EndpointGetUserPlaylist(uid, pid string) string

func EndpointHasTracksSaved

func EndpointHasTracksSaved(ids []string) string

func EndpointMe

func EndpointMe() string

func EndpointRemoveSavedTracks

func EndpointRemoveSavedTracks(ids []string) string

func EndpointReorderTracksInPlaylist

func EndpointReorderTracksInPlaylist(uid, pid string) string

func EndpointReplaceTracksInPlaylist

func EndpointReplaceTracksInPlaylist(uid, pid string) string

func EndpointSaveAlbums

func EndpointSaveAlbums(ids []string) string

func EndpointSaveTracks

func EndpointSaveTracks(ids []string) string

func EndpointSearch

func EndpointSearch(query, typ string) string

func EndpointUnfollowArtists

func EndpointUnfollowArtists(ids []string, typ string) string

func EndpointUnfollowPlaylist

func EndpointUnfollowPlaylist(oid, pid string) string

func EndpointUsersFollowsPlaylist

func EndpointUsersFollowsPlaylist(oid, pid string, ids []string) string

Types

type Album

type Album struct {
	AlbumType            string        `json:"album_type"`
	Artists              []*Artist     `json:"artists"`
	AvailableMarkest     []string      `json:"available_markets"`
	Copyrights           []*Copyright  `json:"copyrights"`
	ExternalIDs          *ExternalIDs  `json:"external_ids"`
	ExternalURLs         *ExternalURLs `json:"external_urls"`
	Genres               []string      `json:"genres"`
	Href                 string        `json:"href"`
	ID                   string        `json:"id"`
	Images               []*Image      `json:"images"`
	Label                string        `json:"label"`
	Name                 string        `json:"name"`
	Popularity           int           `json:"popularity"`
	ReleaseDate          string        `json:"release_date"`
	ReleaseDatePrecision string        `json:"release_date_precision"`
	Tracks               *Paging       `json:"tracks"`
	Type                 string        `json:"type"`
	URI                  string        `json:"uri"`
}

func GetAlbum

func GetAlbum(id string) (*Album, error)

func GetAlbums

func GetAlbums(ids []string) ([]*Album, error)

type Artist

type Artist struct {
	ExternalURLs *ExternalURLs `json:"external_url"`
	Followers    *Follower     `json:"followers"`
	Genres       []string      `json:"genres"`
	Href         string        `json:"href"`
	ID           string        `json:"id"`
	Images       []*Image      `json:"images"`
	Name         string        `json:"name"`
	Popularity   int           `json:"popularity"`
	Type         string        `json:"type"`
	URI          string        `json:"uri"`
}

func GetArtist

func GetArtist(id string) (*Artist, error)

func GetArtists

func GetArtists(ids []string) ([]*Artist, error)

func GetRelatedArtists

func GetRelatedArtists(id string) ([]*Artist, error)

type AudioAnalysis

type AudioAnalysis struct {
	Bars []*struct {
		Start      float32 `json:"start"`
		Duration   float32 `json:"duration"`
		Confidence float32 `json:"confidence"`
	} `json:"bars"`

	Beats []*struct {
		Start      float32 `json:"start"`
		Duration   float32 `json:"duration"`
		Confidence float32 `json:"confidence"`
	} `json:"beats"`

	Meta *struct {
		AnalyzerVersion string  `json:"analyzer_version"`
		Platform        string  `json:"platform"`
		DetailedStatus  string  `json:"detailed_status"`
		StatusCode      int     `json:"status_code"`
		Timestamp       int     `json:"timestamp"`
		AnalysisTime    float32 `json:"analysis_time"`
		InputProcess    string  `json:"input_process"`
	} `json:"meta"`

	Sections []*struct {
		Start                   float32 `json:"start"`
		Duration                float32 `json:"duration"`
		Confidence              float32 `json:"float32"`
		Loudness                float32 `json:"loudness"`
		Tempo                   float32 `json:"tempo"`
		TempoConfidence         float32 `json:"tempo_confidence"`
		Key                     int     `json:"key"`
		KeyConfidence           float32 `json:"key_confidence"`
		Mode                    int     `json:"mode"`
		ModeConfidence          float32 `json:"mode_confidence"`
		TimeSignature           int     `json:"time_signature"`
		TimeSignatureConfidence float32 `json:"time_signature_confidence"`
	} `json:"sections"`

	Segments []*struct {
		Start           float32   `json:"start"`
		Duration        float32   `json:"duration"`
		Confidence      float32   `json:"confidence"`
		LoudnessStart   float32   `json:"loudenss_start"`
		LoudnessMaxTime float32   `json:"loudness_max_time"`
		LoudnessMax     float32   `json:"loudness_max"`
		LoudnessEnd     float32   `json:"loudness_end"`
		Pitches         []float32 `json:"pitches"`
		Timbre          []float32 `json:"timbre"`
	} `json:"segments"`

	Tatums []*struct {
		Start      float32 `json:"start"`
		Duration   float32 `json:"duration"`
		Confidence float32 `json:"confidence"`
	} `json:"tatums"`

	Track *Track `json:"track"`
}

type AudioFeatures

type AudioFeatures struct {
	Acousticness     float32 `json:"acousticness"`
	AnalysisURL      string  `json:"analysis_url"`
	Danceabilitu     float32 `json:"danceability"`
	DurationMs       int     `json:"duration_ms"`
	Energy           float32 `json:"energy"`
	ID               string  `json:"id"`
	Instrumentalness float32 `json:"instrumentalness"`
	Key              int     `json:"key"`
	Liveness         float32 `json:"liveness"`
	Loudness         float32 `json:"loudness"`
	Mode             int     `json:"mode"`
	Speechiness      float32 `json:"speechiness"`
	Tempo            float32 `json:"tempo"`
	TimeSignature    int     `json:"time_signature"`
	TrackHref        string  `json:"track_href"`
	Type             string  `json:"type"`
	URI              string  `json:"uri"`
	Valence          float32 `json:"valence"`
}

type Category

type Category struct {
	Href  string   `json:"href"`
	Icons []*Image `json:"images"`
	ID    string   `json:"id"`
	Name  string   `json:"name"`
}

type Client

type Client struct {
	ClientID     string
	ClientSecret string
	// contains filtered or unexported fields
}

func New

func New(clientid, clientsecret string) *Client

func (*Client) GetAudioAnalysis

func (c *Client) GetAudioAnalysis(id string) (*AudioAnalysis, error)

func (*Client) GetAudioFeature

func (c *Client) GetAudioFeature(id string) (*AudioFeatures, error)

func (*Client) GetAudioFeatures

func (c *Client) GetAudioFeatures(ids []string) ([]*AudioFeatures, error)

func (*Client) GetCategories

func (c *Client) GetCategories(country, locale string, offset, limit int) (*Paging, error)

func (*Client) GetCategory

func (c *Client) GetCategory(name, country, locale string) (*Category, error)

func (*Client) GetCategoryPlaylists

func (c *Client) GetCategoryPlaylists(name, country string, limit, offset int) (*Paging, error)

func (*Client) GetFeaturedPlaylists

func (c *Client) GetFeaturedPlaylists(locale, country, timestamp string, limit, offset int) (*Paging, error)

GetFeaturedPlaylists gets the featured playlists The optional parameters can switch it up Locale: a lowercase ISO 639 language code and an uppercase ISO 3166-1 alpha-2 country code e.g: "es_MX" (Spanish (Mexico)) Country: ISO 3166-1 alpha-2 country code, e.g: "MX" (Mexico) Timestamp: ISO 8601 format, 'yyyy-MM-ddTHH:mm:ss', e.g: "2014-10-02T09:00:00" Limit: Max amount of items, Default is 20, minimum is 1 and maximum is 50 Offset: The index of the first object, default is 0

func (*Client) GetNewReleases

func (c *Client) GetNewReleases(country string, limit, offset int) (*Paging, error)

func (*Client) GetRecommendations

func (c *Client) GetRecommendations(args ...string) (*Recommendations, error)

func (*Client) SearchAlbum

func (c *Client) SearchAlbum(query string, offset int) ([]*Album, error)

func (*Client) SearchArtist

func (c *Client) SearchArtist(query string, offset int) ([]*Artist, error)

func (*Client) SearchTrack

func (c *Client) SearchTrack(query string, offset int) ([]*Track, error)

func (*Client) UserFollowPlaylist

func (c *Client) UserFollowPlaylist(oid, pid string) error

func (*Client) UserUnfollowPlaylist

func (c *Client) UserUnfollowPlaylist(oid, pid string) error

func (*Client) UsersFollowsPlaylist

func (c *Client) UsersFollowsPlaylist(oid, pid string, uid []string) ([]bool, error)
type Copyright struct {
	Text string `json:"text"`
	Type string `json:"type"`
}

type Cursor

type Cursor struct {
	After string `json:"after"`
}

type CursorBasedPaging

type CursorBasedPaging struct {
	Href   string        `json:"href"`
	Items  []interface{} `json:"items"`
	Limit  int           `json:"limit"`
	Next   string        `json:"next"`
	Cursor *Cursor       `json:"cursor"`
	Total  int           `json:"total"`
}

type ExternalIDs

type ExternalIDs struct {
	IDs map[string]string `json:"-"`
}

type ExternalURLs

type ExternalURLs struct {
	URLs map[string]string `json:"-"`
}

type Follower

type Follower struct {
	Href  string `json:"href"`
	Total int    `json:"total"`
}

type Image

type Image struct {
	Height int    `json:"height"`
	Width  int    `json:"width"`
	URL    string `json:"url"`
}

type LinkedTrack

type LinkedTrack struct {
	ExternalURLs *ExternalURLs `json:"external_urls"`
	Href         string        `json:"href"`
	ID           string        `json:"id"`
	Type         string        `json:"type"`
	URI          string        `json:"uri"`
}

type Paging

type Paging struct {
	Href     string          `json:"href"`
	Items    json.RawMessage `json:"items"`
	Limit    int             `json:"limit"`
	Next     string          `json:"next"`
	Offset   int             `json:"offset"`
	Previous string          `json:"previous"`
	Total    int             `json:"total"`
}

func GetAlbumTracks

func GetAlbumTracks(id string) (*Paging, error)

func GetArtistAlbums

func GetArtistAlbums(id string) (*Paging, error)

type Playlist

type Playlist struct {
	Collaborative bool          `json:"collaborative"`
	Description   string        `json:"description"`
	ExternalURLs  *ExternalURLs `json:"external_urls"`
	Followers     *Follower     `json:"followers"`
	Href          string        `json:"href"`
	ID            string        `json:"id"`
	Images        []*Image      `json:"images"`
	Name          string        `json:"name"`
	Owner         *User         `json:"owner"`
	Public        bool          `json:"public,omitempty"`
	SnapshotID    string        `json:"snapshot_id"`
	Tracks        *Paging       `json:"tracks"`
	Type          string        `json:"type"`
	URI           string        `json:"uri"`
}

type PlaylistTrack

type PlaylistTrack struct {
	AddedAt string `json:"added_at"`
	AddedBy *User  `json:"added_by"`
	IsLocal bool   `json:"is_local"`
	Track   *Track `json:"track"`
}

type RecommendationSeed

type RecommendationSeed struct {
	AfterFilteringSize int    `json:"afterFilteringSize"`
	AfterRelinkSize    int    `json:"afterRelinkSize"`
	Href               string `json:"href"`
	ID                 string `json:"id"`
	InitialPoolSize    int    `json:"initialPoolSize"`
	Type               string `json:"type"`
}

type Recommendations

type Recommendations struct {
	Seeds  []*RecommendationSeed `json:"seeds"`
	Tracks []*Track              `json:"tracks"`
}

type SavedAlbum

type SavedAlbum struct {
	AddedAt string `json:"added_at"`
	Album   *Album `json:"album"`
}

type SavedTrack

type SavedTrack struct {
	AddedAt string `json:"added_at"`
	Track   *Track `json:"track"`
}

type SpotifyError

type SpotifyError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type Track

type Track struct {
	Album            *Album        `json:"album"`
	Artists          []*Artist     `json:"artists"`
	AvailableMarkets []string      `json:"available_markets"`
	DiscNumber       int           `json:"disc_number"`
	DurationMs       int           `json:"duration_ms"`
	Explicit         bool          `json:"explicit"`
	ExternalIDs      *ExternalIDs  `json:"external_ids"`
	ExternalURLs     *ExternalURLs `json:"external_urls"`
	Href             string        `json:"href"`
	ID               string        `json:"id"`
	IsPlayable       bool          `json:"is_playable"`
	LinkedFrom       *LinkedTrack  `json:"linked_from"`
	Name             string        `json:"name"`
	Popularity       int           `json:"popularity"`
	PreviewURL       string        `json:"preview_url"`
	TrackNumber      int           `json:"track_number"`
	Type             string        `json:"type"`
	URI              string        `json:"uri"`
}

func GetArtistTopTracks

func GetArtistTopTracks(id string) ([]*Track, error)

type User

type User struct {
	Birthdate    string        `json:"birthdate"`
	Country      string        `json:"country"`
	DisplayName  string        `json:"display_name"`
	Email        string        `json:"email"`
	ExternalURLs *ExternalURLs `json:"external_urls"`
	Followers    *Follower     `json:"followers"`
	Href         string        `json:"href"`
	ID           string        `json:"id"`
	Images       []*Image      `json:"images"`
	Product      string        `json:"product"`
	Type         string        `json:"type"`
	URI          string        `json:"uri"`
}

Jump to

Keyboard shortcuts

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