spotify

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccessTokenClient

func NewAccessTokenClient(token string) *http.Client

func NewTrackStorage

func NewTrackStorage(session *sessions.Session) core.TrackStorage

Types

type Query

type Query struct {
	Name   string
	Artist string
	Album  string
	Genre  string
	Year   string
}

Represents the query options available to Spotify's Search API.

https://developer.spotify.com/console/get-search-item/

func NewQuery

func NewQuery(filters []core.Filter) Query

Converts a slice of core.Filter into a Query.

The current behavior is to use the last value provided for a given field. This means that if multiple filters with FilterKey == Artist were offered, then the last artist value would be sent to Spotify.

This function treats Equal and Contain the same because further filtering is expected to be performed somewhere down the line.

func (Query) String

func (q Query) String() string

Assemble the Query's fields into a Spotify-compatible string. If some fields aren't present (aka they are their zero value) then they won't be part of the built query string.

Jump to

Keyboard shortcuts

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