spotify

package
v0.0.0-...-e8f45de Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBody

func ParseBody[K any](s *SpotifyClient, b *K)

func Request

func Request[T any](s *SpotifyClient, method string, path string) (*T, *http.Response, error)

Types

type ArtistObject

type ArtistObject struct {
	Followers  followers `json:"followers"`
	Genres     []string  `json:"genres"`
	Images     []image   `json:"images"`
	Popularity int       `json:"popularity"`
	// contains filtered or unexported fields
}

type SpotifyClient

type SpotifyClient struct {
	Auth        oauth2.Token
	Body        []byte
	QueryParams map[string]string
}

func (*SpotifyClient) CheckUserFollowsPlaylist

func (s *SpotifyClient) CheckUserFollowsPlaylist(id string) (*[]bool, *http.Response, error)

func (*SpotifyClient) CheckUserFollowsUsersOrArtists

func (s *SpotifyClient) CheckUserFollowsUsersOrArtists() (*[]bool, *http.Response, error)

func (*SpotifyClient) FollowPlaylist

func (*SpotifyClient) FollowUsersOrArtists

func (s *SpotifyClient) FollowUsersOrArtists() (*SpotifyEmptyResponse, *http.Response, error)

func (*SpotifyClient) GetFollowedArtists

func (*SpotifyClient) GetMe

func (s *SpotifyClient) GetMe() (*SpotifyUser, *http.Response, error)

func (*SpotifyClient) GetProfile

func (s *SpotifyClient) GetProfile(id string) (*SpotifyUser, *http.Response, error)

func (*SpotifyClient) GetUserTopArtists

func (s *SpotifyClient) GetUserTopArtists() (*SpotifyUserTopItems[ArtistObject], *http.Response, error)

func (*SpotifyClient) GetUserTopTracks

func (s *SpotifyClient) GetUserTopTracks() (*SpotifyUserTopItems[TrackObject], *http.Response, error)

func (*SpotifyClient) Login

func (s *SpotifyClient) Login() (*oauth2.Token, error)

func (*SpotifyClient) RefreshToken

func (s *SpotifyClient) RefreshToken() error

func (*SpotifyClient) UnfollowPlaylist

func (s *SpotifyClient) UnfollowPlaylist(id string) (*SpotifyEmptyResponse, *http.Response, error)

func (*SpotifyClient) UnfollowUsersOrArtists

func (s *SpotifyClient) UnfollowUsersOrArtists() (*SpotifyEmptyResponse, *http.Response, error)

type SpotifyEmptyResponse

type SpotifyEmptyResponse struct{}

type SpotifyFollowedArtistsResponse

type SpotifyFollowedArtistsResponse[K any] struct {
	Artists SpotifyListObject[K] `json:"artists"`
}

type SpotifyListObject

type SpotifyListObject[K any] struct {
	Href    string  `json:"href"`
	Limit   int     `json:"limit"`
	Next    string  `json:"next"`
	Cursors cursors `json:"cursors"`
	Total   int     `json:"total"`
	Items   []K     `json:"items"`
}

type SpotifyPlaylistFollowRequest

type SpotifyPlaylistFollowRequest struct {
	Public bool `json:"public"`
}

type SpotifyUser

type SpotifyUser struct {
	Country         string          `json:"country,omitempty"`
	DisplayName     string          `json:"display_name"`
	Email           string          `json:"email,omitempty"`
	ExplicitContent explicitContent `json:"explicit_content,omitempty"`
	ExternalUrls    externalUrls    `json:"external_urls"`
	Followers       followers       `json:"followers"`
	Href            string          `json:"href"`
	Id              string          `json:"id"`
	Images          []image         `json:"images"`
	Product         string          `json:"product,omitempty"`
	Type            string          `json:"type"`
	Uri             string          `json:"uri"`
}

type SpotifyUserTopItems

type SpotifyUserTopItems[K any] struct {
	Href     string `json:"href"`
	Limit    int    `json:"limit"`
	Next     string `json:"next"`
	Offset   int    `json:"offset"`
	Previous string `json:"previous"`
	Total    int    `json:"total"`
	Items    []K    `json:"items"`
}

type TrackObject

type TrackObject struct {
	Album            album          `json:"album"`
	Artists          []ArtistObject `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       *TrackObject   `json:"linked_from"`
	Restrictions     restrictions   `json:"restrictions"`
	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"`
	IsLocal          bool           `json:"is_local"`
}

Jump to

Keyboard shortcuts

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