spotify

package
v0.0.0-...-aae57fb Latest Latest
Warning

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

Go to latest
Published: May 18, 2017 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	TokenFile    string `json:"token_file"`
	// contains filtered or unexported fields
}

func (*Auth) Callback

func (auth *Auth) Callback(w http.ResponseWriter, r *http.Request)

func (*Auth) CallbackURL

func (auth *Auth) CallbackURL() string

func (*Auth) ListenURL

func (auth *Auth) ListenURL() string

func (*Auth) Login

func (auth *Auth) Login(w http.ResponseWriter, r *http.Request)

func (*Auth) Serve

func (auth *Auth) Serve(listen string) error

func (*Auth) URL

func (auth *Auth) URL() string

type NewPlaylist

type NewPlaylist struct {
	Name   string `json:"name"`
	Public bool   `json:"public"`
}

type Playlist

type Playlist struct {
	Id     string         `json:"id"`
	Name   string         `json:"name"`
	Tracks PlaylistTracks `json:"tracks"`
}

func (*Playlist) Contains

func (playlist *Playlist) Contains(track Track) bool

func (*Playlist) String

func (playlist *Playlist) String() string

type PlaylistTrack

type PlaylistTrack struct {
	Track Track `json:"track"`
}

type PlaylistTracks

type PlaylistTracks struct {
	Limit    int             `json:"limit"`
	Next     string          `json:"next"`
	Offset   int             `json:"offset"`
	Previous string          `json:"previous"`
	Total    int             `json:"total"`
	Items    []PlaylistTrack `json:"items"`
}

type Playlists

type Playlists struct {
	Items []Playlist `json:"items"`
}

type Profile

type Profile struct {
	ExternalUrls map[string]string `json:"external_urls"`
	Href         string            `json:"href"`
	Id           string            `json:"id"`
	Type         string            `json:"type"`
	Uri          string            `json:"uri"`
}

type SearchResult

type SearchResult struct {
	Tracks SearchTracks `json:"tracks"`
}

type SearchTracks

type SearchTracks struct {
	Items []Track `json:"items"`
}

type Spotify

type Spotify struct {
	Token   `json:"token"`
	Auth    `json:"auth"`
	Profile `json:"profile"`
}

func New

func New(filepath string) (*Spotify, error)

func (*Spotify) AddTrack

func (spotify *Spotify) AddTrack(playlist *Playlist, track *Track) error

func (*Spotify) AddTracks

func (spotify *Spotify) AddTracks(playlist *Playlist, tracks []Track) error

func (*Spotify) CurrentUser

func (spotify *Spotify) CurrentUser() (*Profile, error)

func (*Spotify) DeleteTrack

func (spotify *Spotify) DeleteTrack(playlist *Playlist, track *Track) error

func (*Spotify) DeleteTracks

func (spotify *Spotify) DeleteTracks(playlist *Playlist, tracks []Track) error

func (*Spotify) GetOrCreatePlaylist

func (spotify *Spotify) GetOrCreatePlaylist(name string) (*Playlist, error)

func (*Spotify) Playlist

func (spotify *Spotify) Playlist(name string) (*Playlist, error)

func (*Spotify) PlaylistById

func (spotify *Spotify) PlaylistById(playlistId string) (*Playlist, error)

func (*Spotify) Playlists

func (spotify *Spotify) Playlists() ([]Playlist, error)

func (*Spotify) RecentTracks

func (spotify *Spotify) RecentTracks(playlist *Playlist,
	n int) ([]PlaylistTrack, error)

func (*Spotify) Save

func (spotify *Spotify) Save(filepath string) error

func (*Spotify) Search

func (spotify *Spotify) Search(query string, types string, limit int) ([]Track,
	error)

func (*Spotify) SearchArtistTrack

func (spotify *Spotify) SearchArtistTrack(artist string, track string) ([]Track,
	error)

func (*Spotify) SetCurrentUser

func (spotify *Spotify) SetCurrentUser() error

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

type Track

type Track struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	Uri  string `json:"uri"`
}

func (*Track) String

func (track *Track) String() string

Jump to

Keyboard shortcuts

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