spotify

package
v0.0.0-...-2aec8f2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: Unlicense Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SPOTIFY_ID     string
	SPOTIFY_SECRET string
)
View Source
var Spotify = spotify{
	Name: "Spotify",
}

Functions

func CompleteSpotifyAuth

func CompleteSpotifyAuth(c *fiber.Ctx) error

func SpotifyAuthHandler

func SpotifyAuthHandler(c *fiber.Ctx) error

Types

type SpotifyItem

type SpotifyItem struct {
	Album struct {
		AlbumType string `json:"album_type"`
		Artists   []struct {
			ExternalUrls struct {
				Spotify string `json:"spotify"`
			} `json:"external_urls"`
			Href string `json:"href"`
			ID   string `json:"id"`
			Name string `json:"name"`
			Type string `json:"type"`
			URI  string `json:"uri"`
		} `json:"artists"`
		ExternalUrls struct {
			Spotify string `json:"spotify"`
		} `json:"external_urls"`
		Href   string `json:"href"`
		ID     string `json:"id"`
		Images []struct {
			Height int    `json:"height"`
			URL    string `json:"url"`
			Width  int    `json:"width"`
		} `json:"images"`
		Name                 string `json:"name"`
		ReleaseDate          string `json:"release_date"`
		ReleaseDatePrecision string `json:"release_date_precision"`
		TotalTracks          int    `json:"total_tracks"`
		Type                 string `json:"type"`
		URI                  string `json:"uri"`
	} `json:"album"`
	Artists []struct {
		ExternalUrls struct {
			Spotify string `json:"spotify"`
		} `json:"external_urls"`
		Href string `json:"href"`
		ID   string `json:"id"`
		Name string `json:"name"`
		Type string `json:"type"`
		URI  string `json:"uri"`
	} `json:"artists"`
	DiscNumber  int  `json:"disc_number"`
	DurationMs  int  `json:"duration_ms"`
	Explicit    bool `json:"explicit"`
	ExternalIds struct {
		Isrc string `json:"isrc"`
	} `json:"external_ids"`
	ExternalUrls struct {
		Spotify string `json:"spotify"`
	} `json:"external_urls"`
	Href        string `json:"href"`
	ID          string `json:"id"`
	IsLocal     bool   `json:"is_local"`
	IsPlayable  bool   `json:"is_playable"`
	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"`
}

type SpotifyLastPlayed

type SpotifyLastPlayed struct {
	Items []struct {
		Track    SpotifyItem `json:"track"`
		PlayedAt string      `json:"played_at"`
	}
}

type SpotifyPlayingResponse

type SpotifyPlayingResponse struct {
	IsPlaying  bool         `json:"is_playing"`
	Item       *SpotifyItem `json:"item"`
	ProgressMs int          `json:"progress_ms"`
	Timestamp  int          `json:"timestamp"`
}

type SpotifyRefreshResponse

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

func Refresh

func Refresh(refresh_token string) (refreshResponse *SpotifyRefreshResponse)

Jump to

Keyboard shortcuts

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