Documentation ¶
Index ¶
Constants ¶
const ( CommandFetch = "ALBUM_FETCH" CommandTOC = "ALBUM_TOC" )
Constants for supported Gracenote commands.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Auth stores the required authentication strings needed to use // the Gracenote API. // // Both Client and User fields of Auth are required, an error will be // returned if either are empty. Auth Auth `xml:"AUTH"` // Language sets the LANG parameter of the Gracenote request. // // If Language is empty, it will be omitted from the query. Language string `xml:"LANG,omitempty"` // Country sets the COUNTRY parameter of the Gracenote request. // // If Country is empty, it will be omitted from the query. Country string `xml:"COUNTRY,omitempty"` // HTTPClient is the HTTP client used to query the Gracenote API. // // If HTTPClient is nil, http.DefaultClient is used. HTTPClient *http.Client `xml:"-"` }
A client to query Gracenote.
For specifics on the effects of the Language and Country parameters, please refer to the follow articles: https://developer.gracenote.com/sites/default/files/web/webapi/Content/music-web-api/Setting%20the%20Language%20Preference.html
func (*Client) SetCountry ¶
func (*Client) SetHTTPClient ¶
func (*Client) SetLanguage ¶
type Query ¶
type Query struct { Command string `xml:"CMD,attr"` ID string `xml:"GN_ID,omitempty"` TOC *TOC `xml:"TOC,omitempty"` }
Gracenote query
Command field is required, an error will be returned if it is empty.
func (*Query) SetCommand ¶
type TOC ¶
type TOC struct {
Offsets string `xml:"OFFSETS,omitempty"`
}
TOC describes the Table of Contents of an Audio CD.
Gracenote expects the TOC to contain the absolute frame offset to the start of each track, with the final offset being the total CD length in frames. Each offset should be separated by a space.
Gracenote expects the offsets to include the lead-in frames of the CD, and will return an error if the TOC contains any offset less than 1.