spotify

package
v0.0.0-...-725bef3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpotifyDetailedStreams struct {
	SpotifyStreamsElement []struct {
		Date    string `json:"date"`
		Starts  int    `json:"starts"`
		Streams int    `json:"streams"`
	} `json:"detailedStreams"`
}

SPOTIFY json types ========================

View Source
var SpotifyListeners struct {
	SpotifyListenersElement []struct {
		Date  string `json:"date"`
		Count int    `json:"streams"`
	} `json:"counts"`
}

Functions

func Analytics

func Analytics(startDate, endDate, endpoint string) (interface{}, error)

func GetDataAPI

func GetDataAPI(startDate, endDate, endpoint string) ([]byte, error)

func GetDataAPI (startDate, endDate, endpoint string) (map[string]interface{}, error) {

func GetSpotifyAccessToken

func GetSpotifyAccessToken() string

func SpotifyStreams

func SpotifyStreams(startDate, endDate string)

func TimeAnalytics

func TimeAnalytics(startDate, endDate string, endpoints []string) (map[string][]data.DailyAnalytics, error)

Types

type DetailedStreamsData

type DetailedStreamsData struct {
	Date    string `json:"date"`
	Starts  int    `json:"starts"`
	Streams int    `json:"streams"`
}

Data structure for detailedStreams endpoint

type ListenersData

type ListenersData struct {
	Date  string `json:"date"`
	Count int    `json:"count"`
}

Data structure for listeners endpoint

type ResponseData

type ResponseData struct {
	Counts          []ListenersData       `json:"counts"`
	DetailedStreams []DetailedStreamsData `json:"detailedStreams"`
}

Define a struct to match the API response format

Jump to

Keyboard shortcuts

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