Documentation
¶
Index ¶
- type Actions
- type Album
- type AlbumParams
- type AlbumService
- type Albums
- type AlbumsResult
- type AnalysisMeta
- type AnalysisTrack
- type Artist
- type ArtistAlbumsParams
- type ArtistParams
- type ArtistService
- func (s *ArtistService) Get(ID string) (*Artist, error)
- func (s *ArtistService) GetAlbums(ID, includeGroups, market string, limit, offset int) (*Albums, error)
- func (s *ArtistService) GetTopTracks(ID, country string) (*TracksResult, error)
- func (s *ArtistService) List(IDs string) (*ArtistsResult, error)
- func (s *ArtistService) RelatedArtists(ID string) (*ArtistsResult, error)
- type Artists
- type ArtistsResult
- type AudioAnalysis
- type AudioFeatures
- type AudioFeaturesResult
- type CategoryService
- type Client
- type Context
- type Copyright
- type CountryParams
- type CreatePlaylist
- type Error
- type ExternalIDs
- type ExternalURLs
- type Followers
- type ID
- type Image
- type Key
- type LibraryParams
- type LibraryService
- func (s *LibraryService) CheckCurrentUserSavedAlbums(IDs string) (*[]bool, error)
- func (s *LibraryService) CheckCurrentUserSavedTracks(IDs string) (*[]bool, error)
- func (s *LibraryService) GetCurrentUserSavedAlbums(limit, offset int) (*SavedAlbums, error)
- func (s *LibraryService) GetCurrentUserSavedTracks(limit, offset int) (*SavedTracks, error)
- type Marker
- type MeService
- type Mode
- type PaginationParams
- type PlayerService
- type PlayingTrack
- type Playlist
- type PlaylistAddTracks
- type PlaylistService
- func (s *PlaylistService) AddTracksToPlaylists(playlistID string, tracksIDS string) (*PlaylistAddTracks, error)
- func (s *PlaylistService) CreatePlaylist(userID string, name string, description string, public bool) (*CreatePlaylist, error)
- func (s *PlaylistService) Get(ID string) (*Playlist, error)
- func (s *PlaylistService) GetCoverImages(ID string) (*[]Image, error)
- func (s *PlaylistService) GetCurrentUserPlaylists(limit, offset int) (*Playlists, error)
- func (s *PlaylistService) GetTracks(ID string, limit, offset int) (*PlaylistTracks, error)
- func (s *PlaylistService) GetUserPlaylists(userID string, limit, offset int) (*Playlists, error)
- type PlaylistTracks
- type Playlists
- type Profile
- type RecentlyPlayedTracks
- type RecentlyPlayedTracksParams
- type SavedAlbums
- type SavedTracks
- type SearchParams
- type SearchResult
- type SearchService
- type Section
- type Segment
- type SpfError
- type Track
- type TrackParams
- type TrackService
- func (s *TrackService) AudioAnalysis(ID string) (*AudioAnalysis, error)
- func (s *TrackService) AudioFeatures(IDs string) (*AudioFeaturesResult, error)
- func (s *TrackService) AudioFeaturesByTrackID(ID string) (*AudioFeatures, error)
- func (s *TrackService) Get(ID string) (*Track, error)
- func (s *TrackService) List(IDs string) (*TracksResult, error)
- type Tracks
- type TracksResult
- type URI
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actions ¶
type Actions struct {
Disallows *struct {
Resuming bool `json:"resuming,omitempty"`
} `json:"disallows,omitempty"`
}
type Album ¶
type Album struct {
AlbumType string `json:"album_type,omitempty"`
Artists []Artist `json:"artists,omitempty"`
AvailableMarkets []string `json:"available_markets,omitempty"`
Copyrights []Copyright `json:"copyrights,omitempty"`
ExternalIDs *ExternalIDs `json:"external_ids,omitempty"`
ExternalURLs *ExternalURLs `json:"external_urls,omitempty"`
Genres []string `json:"genres,omitempty"`
Href string `json:"href,omitempty"`
ID string `json:"id,omitempty"`
Images []Image `json:"images,omitempty"`
Label string `json:"label,omitempty"`
Name string `json:"name,omitempty"`
Popularity int `json:"popularity,omitempty"`
ReleaseDate string `json:"release_date,omitempty"`
ReleaseDatePrecision string `json:"release_date_precision,omitempty"`
TotalTracks int `json:"total_tracks,omitempty"`
Tracks *Tracks `json:"tracks,omitempty"`
Type string `json:"type,omitempty"`
URI string `json:"uri,omitempty"`
}
type AlbumParams ¶
type AlbumParams struct {
IDs string `url:"ids,omitempty"`
}
type AlbumService ¶
type AlbumService service
func (*AlbumService) GetTracks ¶
func (s *AlbumService) GetTracks(ID string, limit, offset int) (*Tracks, error)
func (*AlbumService) List ¶
func (s *AlbumService) List(IDs string) (*AlbumsResult, error)
type AlbumsResult ¶
type AlbumsResult struct {
Albums []Album `json:"albums,omitempty"`
}
type AnalysisMeta ¶
type AnalysisMeta struct {
AnalyzerVersion string `json:"analyzer_version,omitempty"`
Platform string `json:"platform,omitempty"`
DetailedStatus string `json:"detailed_status,omitempty"`
StatusCode int `json:"status,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
AnalysisTime float64 `json:"analysis_time,omitempty"`
InputProcess string `json:"input_process,omitempty"`
}
AnalysisMeta describes details about Spotify's audio analysis of the track
type AnalysisTrack ¶
type AnalysisTrack struct {
NumSamples int64 `json:"num_samples,omitempty"`
Duration float64 `json:"duration,omitempty"`
SampleMD5 string `json:"sample_md5,omitempty"`
OffsetSeconds int `json:"offset_seconds,omitempty"`
WindowSeconds int `json:"window_seconds,omitempty"`
AnalysisSampleRate int64 `json:"analysis_sample_rate,omitempty"`
AnalysisChannels int `json:"analysis_channels,omitempty"`
EndOfFadeIn float64 `json:"end_of_fade_in,omitempty"`
StartOfFadeOut float64 `json:"start_of_fade_out,omitempty"`
Loudness float64 `json:"loudness,omitempty"`
Tempo float64 `json:"tempo,omitempty"`
TempoConfidence float64 `json:"tempo_confidence,omitempty"`
TimeSignature int `json:"time_signature,omitempty"`
TimeSignatureConfidence float64 `json:"time_signature_confidence,omitempty"`
Key Key `json:"key,omitempty"`
KeyConfidence float64 `json:"key_confidence,omitempty"`
Mode Mode `json:"mode,omitempty"`
ModeConfidence float64 `json:"mode_confidence,omitempty"`
CodeString string `json:"codestring,omitempty"`
CodeVersion float64 `json:"code_version,omitempty"`
EchoprintString string `json:"echoprintstring,omitempty"`
EchoprintVersion float64 `json:"echoprint_version,omitempty"`
SynchString string `json:"synchstring,omitempty"`
SynchVersion float64 `json:"synch_version,omitempty"`
RhythmString string `json:"rhythmstring,omitempty"`
RhythmVersion float64 `json:"rhythm_version,omitempty"`
}
AnalysisTrack contains audio analysis data about the track as a whole
type Artist ¶
type Artist struct {
Name string `json:"name,omitempty"`
ID ID `json:"id,omitempty"`
URI URI `json:"uri,omitempty"`
Href string `json:"href,omitempty"`
ExternalURLs ExternalURLs `json:"external_urls,omitempty"`
Type string `json:"type,omitempty"`
Followers *Followers `json:"followers,omitempty"`
Genres []string `json:"genres,omitempty"`
Images []Image `json:"images,omitempty"`
Popularity int `json:"popularity,omitempty"`
}
type ArtistAlbumsParams ¶
type ArtistParams ¶
type ArtistParams struct {
IDs string `url:"ids,omitempty"`
}
type ArtistService ¶
type ArtistService service
func (*ArtistService) GetAlbums ¶
func (s *ArtistService) GetAlbums(ID, includeGroups, market string, limit, offset int) (*Albums, error)
func (*ArtistService) GetTopTracks ¶
func (s *ArtistService) GetTopTracks(ID, country string) (*TracksResult, error)
func (*ArtistService) List ¶
func (s *ArtistService) List(IDs string) (*ArtistsResult, error)
func (*ArtistService) RelatedArtists ¶
func (s *ArtistService) RelatedArtists(ID string) (*ArtistsResult, error)
type ArtistsResult ¶
type ArtistsResult struct {
Artists []Artist `json:"artists,omitempty"`
}
type AudioAnalysis ¶
type AudioAnalysis struct {
Bars []Marker `json:"bars,omitempty"`
Beats []Marker `json:"beats,omitempty"`
Meta AnalysisMeta `json:"meta,omitempty"`
Sections []Section `json:"sections,omitempty"`
Segments []Segment `json:"segments,omitempty"`
Tatums []Marker `json:"tatums,omitempty"`
Track AnalysisTrack `json:"track,omitempty"`
}
type AudioFeatures ¶
type AudioFeatures struct {
Danceability float32 `json:"danceablity,omitempty"`
Energy float32 `json:"energy,omitempty"`
Key int `json:"key,omitempty"`
Loudness float32 `json:"loudness,omitempty"`
Mode int `json:"mode,omitempty"`
Speechiness float32 `json:"speechiness,omitempty"`
Acousticness float32 `json:"acousticness,omitempty"`
Instrumentalness float32 `json:"instrumentalness,omitempty"`
Liveness float32 `json:"liveness,omitempty"`
Valence float32 `json:"valence,omitempty"`
Tempo float32 `json:"tempo,omitempty"`
Type string `json:"type,omitempty"`
ID ID `json:"id,omitempty"`
URI URI `json:"uri,omitempty"`
TrackHref string `json:"track_href,omitempty"`
AnalysisURL string `json:"analysis_url,omitempty"`
DurationMS int `json:"duration_ms,omitempty"`
TimeSignature int `json:"time_signature,omitempty"`
}
type AudioFeaturesResult ¶
type AudioFeaturesResult struct {
AudioFeatures []AudioFeatures `json:"audio_features,omitempty"`
}
type CategoryService ¶
type CategoryService service
type Client ¶
type Client struct {
Album *AlbumService
Artist *ArtistService
Category *CategoryService
Library *LibraryService
Me *MeService
Playlist *PlaylistService
Player *PlayerService
Search *SearchService
Track *TrackService
User *UserService
// contains filtered or unexported fields
}
type Context ¶
type Context struct {
ExternalURLs ExternalURLs `json:"external_urls,omitempty"`
Href string `json:"href,omitempty"`
Type string `json:"type,omitempty"`
URI URI `json:"uri,omitempty"`
}
type CountryParams ¶
type CountryParams struct {
Country string `url:"country,omitempty"`
}
type CreatePlaylist ¶
type ExternalIDs ¶
type ExternalIDs struct {
UPC string `json:"upc,omitempty"`
}
type ExternalURLs ¶
type ExternalURLs struct {
Spotify string `json:"spotify,omitempty"`
}
type ID ¶
type ID string
ID is a base-62 identifier for an artist, track, album, etc. It can be found at the end of a spotify.URI.
type LibraryParams ¶
type LibraryParams struct {
IDs string `url:"ids"`
}
type LibraryService ¶
type LibraryService service
func (*LibraryService) CheckCurrentUserSavedAlbums ¶
func (s *LibraryService) CheckCurrentUserSavedAlbums(IDs string) (*[]bool, error)
func (*LibraryService) CheckCurrentUserSavedTracks ¶
func (s *LibraryService) CheckCurrentUserSavedTracks(IDs string) (*[]bool, error)
func (*LibraryService) GetCurrentUserSavedAlbums ¶
func (s *LibraryService) GetCurrentUserSavedAlbums(limit, offset int) (*SavedAlbums, error)
func (*LibraryService) GetCurrentUserSavedTracks ¶
func (s *LibraryService) GetCurrentUserSavedTracks(limit, offset int) (*SavedTracks, error)
type Marker ¶
type Marker struct {
Start float64 `json:"start,omitempty"`
Duration float64 `json:"duration,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
}
Marker represents beats, bars, tatums and are used in segment and section descriptions.
type PaginationParams ¶
type PlayerService ¶
type PlayerService service
func (*PlayerService) GetCurrentlyPlaying ¶
func (s *PlayerService) GetCurrentlyPlaying() (*PlayingTrack, error)
func (*PlayerService) GetRecentlyPlayed ¶
func (s *PlayerService) GetRecentlyPlayed(filter string, limit, after int) (*RecentlyPlayedTracks, error)
type PlayingTrack ¶
type PlayingTrack struct {
Timestamp int `json:"timestamp,omitempty"`
Context *Context `json:"context,omitempty"`
ProgressMS int `json:"progress_ms,omitempty"`
Item *Track `json:"item,omitempty"`
CurrentlyPlayingType string `json:"currently_playing_type,omitempty"`
Actions *Actions `json:"actions,omitempty"`
IsPlaying bool `json:"is_playing,omitempty"`
}
type Playlist ¶
type Playlist struct {
Collaborative bool `json:"collaborative,omitempty"`
Description string `json:"description,omitempty"`
ExternalURLs *ExternalURLs `json:"external_urls,omitempty"`
Followers *Followers `json:"followers,omitempty"`
Href string `json:"href,omitempty"`
ID ID `json:"id,omitempty"`
Images []Image `json:"images,omitempty"`
Name string `json:"name,omitempty"`
Owner *Profile `json:"profile,omitempty"`
PrimaryColor string `json:"primary_color,omitempty"`
Public bool `json:"public,omitempty"`
SnapshotID string `json:"snapshot_id,omitempty"`
Tracks *PlaylistTracks `json:"tracks,omitempty"`
}
type PlaylistAddTracks ¶
type PlaylistAddTracks struct {
SnapshotID string `json:"snapshot_id"`
}
type PlaylistService ¶
type PlaylistService service
func (*PlaylistService) AddTracksToPlaylists ¶
func (s *PlaylistService) AddTracksToPlaylists(playlistID string, tracksIDS string) (*PlaylistAddTracks, error)
func (*PlaylistService) CreatePlaylist ¶
func (s *PlaylistService) CreatePlaylist(userID string, name string, description string, public bool) (*CreatePlaylist, error)
func (*PlaylistService) GetCoverImages ¶
func (s *PlaylistService) GetCoverImages(ID string) (*[]Image, error)
func (*PlaylistService) GetCurrentUserPlaylists ¶
func (s *PlaylistService) GetCurrentUserPlaylists(limit, offset int) (*Playlists, error)
func (*PlaylistService) GetTracks ¶
func (s *PlaylistService) GetTracks(ID string, limit, offset int) (*PlaylistTracks, error)
func (*PlaylistService) GetUserPlaylists ¶
func (s *PlaylistService) GetUserPlaylists(userID string, limit, offset int) (*Playlists, error)
type PlaylistTracks ¶
type PlaylistTracks struct {
Href string `json:"href,omitempty"`
Items []struct {
AddedAt string `json:"added_at,omitempty"`
AddedBy *Profile `json:"added_by,omitempty"`
IsLocal bool `json:"is_local,omitempty"`
PrimaryColor string `json:"primary_color,omitempty"`
Track *Track `json:"track,omitempty"`
VideoThumbnail *struct {
URL string `json:"url,omitempty"`
} `json:"video_thumbnail,omitempty"`
} `json:"items,omitempty"`
}
type Profile ¶
type Profile struct {
DisplayName string `json:"display_name,omitempty"`
ExternalURLs *ExternalURLs `json:"external_urls,omitempty"`
Followers *Followers `json:"followers,omitempty"`
Href string `json:"href,omitempty"`
ID ID `json:"id,omitempty"`
Images []Image `json:"images,omitempty"`
Type string `json:"type,omitempty"`
URI URI `json:"uri,omitempty"`
}
type RecentlyPlayedTracks ¶
type RecentlyPlayedTracks struct {
Items []struct {
Track *Track `json:"track,omitempty"`
PlayedAt string `json:"played_at,omitempty"`
Context *Context `json:"context,omitempty"`
} `json:"items,omitempty"`
Next string `json:"next,omitempty"`
Cursors *struct {
After string `json:"after,omitempty"`
Before string `json:"before,omitempty"`
} `json:"cursors,omitempty"`
Limit int `json:"limit,omitempty"`
Href string `json:"href,omitmepty"`
}
type SavedAlbums ¶
type SavedAlbums struct {
Href string `json:"href,omitempty"`
Items []struct {
AddedAt string `json:"added_at,omitempty"`
Album *Album `json:"album,omitempty"`
} `json:"items,omitempty"`
Limit int `json:"limit,omitempty"`
Next string `json:"next,omitempty"`
Offset int `json:"offset,omitempty"`
Previous string `json:"previous,omitempty"`
Total int `json:"total,omitempty"`
}
type SavedTracks ¶
type SavedTracks struct {
Href string `json:"href,omitempty"`
Items []struct {
AddedAt string `json:"added_at,omitempty"`
Track *Track `json:"track,omitempty"`
} `json:"items,omitempty"`
Limit int `json:"limit,omitempty"`
Next string `json:"next,omitempty"`
Offset int `json:"offset,omitempty"`
Previous string `json:"previous,omitempty"`
Total int `json:"total,omitempty"`
}
type SearchParams ¶
type SearchResult ¶
type SearchService ¶
type SearchService service
func (*SearchService) Get ¶
func (s *SearchService) Get(query, filter string, limit, offset int) (*SearchResult, error)
type Section ¶
type Section struct {
Marker
Loudness float64 `json:"loudness,omitempty"`
Tempo float64 `json:"tempo,omitempty"`
TempoConfidence float64 `json:"tempo_confidence,omitempty"`
Key Key `json:"key,omitempty"`
KeyConfidence float64 `json:"key_confidence,omitempty"`
Mode Mode `json:"mode,omitempty"`
ModeConfidence float64 `json:"mode_confidence,omitempty"`
TimeSignature int `json:"time_signature,omitempty"`
TimeSignatureConfidence float64 `json:"time_signature_confidence,omitempty"`
}
Section represents a large variation in rhythm or timbre, e.g. chorus, verse, bridge, guitar solo, etc. Each section contains its own descriptions of tempo, key, mode, time_signature, and loudness.
type Segment ¶
type Segment struct {
Marker
LoudnessStart float64 `json:"loudness_start,omitempty"`
LoudnessMaxTime float64 `json:"loudness_max_time,omitempty"`
LoudnessMax float64 `json:"loudness_max,omitempty"`
LoudnessEnd float64 `json:"loudness_end,omitempty"`
Pitches []float64 `json:"pitches,omitempty"`
Timbre []float64 `json:"timbre,omitempty"`
}
Segment is characterized by it's perceptual onset and duration in seconds, loudness (dB), pitch and timbral content.
type Track ¶
type Track struct {
Artists []Artist `json:"artists,omitempty"`
Album *Album `json:"album,omitempty"`
ExternalIDs *ExternalIDs `json:"external_ids,omitempty"`
Popularity int `json:"popularity,omitempty"`
DiscNumber int `json:"disc_number,omitempty"`
DurationMS int `json:"duration_ms,omitempty"`
ID string `json:"id,omitempty"`
Href string `json:"href,omitempty"`
IsLocal bool `json:"is_local,omitempty"`
IsPlayable bool `json:"is_playable,omitempty"`
Name string `json:"name,omitempty"`
PreviewURL string `json:"preview_url,omitempty"`
TrackNumber int `json:"track_number,omitempty"`
Type string `json:"type,omitempty"`
URI string `json:"uri,omitempty"`
}
type TrackParams ¶
type TrackParams struct {
IDs string `url:"ids,omitempty"`
}
type TrackService ¶
type TrackService service
func (*TrackService) AudioAnalysis ¶
func (s *TrackService) AudioAnalysis(ID string) (*AudioAnalysis, error)
func (*TrackService) AudioFeatures ¶
func (s *TrackService) AudioFeatures(IDs string) (*AudioFeaturesResult, error)
func (*TrackService) AudioFeaturesByTrackID ¶
func (s *TrackService) AudioFeaturesByTrackID(ID string) (*AudioFeatures, error)
func (*TrackService) List ¶
func (s *TrackService) List(IDs string) (*TracksResult, error)
type TracksResult ¶
type TracksResult struct {
Tracks []Track `json:"tracks,omitempty"`
}
type URI ¶
type URI string
URI identifies an artist, album, track, or category. For example, spotify:track:6rqhFgbbKwnb9MLmUQDhG6
type UserService ¶
type UserService service
func (*UserService) GetProfile ¶
func (s *UserService) GetProfile(ID string) (*Profile, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
albums/get-album
command
|
|
|
albums/get-album-tracks
command
|
|
|
albums/get-albums
command
|
|
|
artists/get-artist
command
|
|
|
artists/get-artist-albums
command
|
|
|
artists/get-artist-related
command
|
|
|
artists/get-artist-top-tracks
command
|
|
|
artists/get-artists
command
|
|
|
player/currently-playing
command
|
|
|
player/recently-played
command
|
|
|
playlists/add-track-playlists
command
|
|
|
playlists/create-playlist
command
|
|
|
playlists/get-my-playlists
command
|
|
|
playlists/get-playlist
command
|
|
|
playlists/get-playlist-cover
command
|
|
|
playlists/get-playlist-tracks
command
|
|
|
playlists/get-user-playlists
command
|
|
|
search
command
|
|
|
tracks/get-audio-analysis
command
|
|
|
tracks/get-track
command
|
|
|
tracks/get-track-audio-features
command
|
|
|
tracks/get-tracks
command
|
|
|
tracks/get-tracks-audio-features
command
|
|
|
users-profile/get-user-profile
command
|