Documentation
¶
Overview ¶
Package itunes exposes the iTunes Search API as a kit Domain driver.
A multi-domain host (ant) enables it with a single blank import:
import _ "github.com/tamnd/itunes-cli/itunes"
The same Domain also builds the standalone itunes binary (see cli.NewApp).
Package itunes is the library behind the itunes command line: the HTTP client, request shaping, and the typed data models for the iTunes Search API (itunes.apple.com). No API key required.
Index ¶
Constants ¶
const Host = "itunes.apple.com"
Host is the API host this client talks to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the iTunes API over HTTP.
type Config ¶
type Config struct {
BaseURL string
UserAgent string
Rate time.Duration
Timeout time.Duration
Retries int
}
Config holds all tunable parameters for the Client.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
type Domain ¶
type Domain struct{}
Domain is the itunes driver.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.
type Result ¶
type Result struct {
WrapperType string `json:"wrapperType"`
Kind string `json:"kind,omitempty"`
CollectionID int64 `json:"collectionId,omitempty"`
TrackID int64 `json:"trackId,omitempty"`
ArtistID int64 `json:"artistId,omitempty"`
ArtistName string `json:"artistName,omitempty"`
CollectionName string `json:"collectionName,omitempty"`
TrackName string `json:"trackName,omitempty"`
PreviewURL string `json:"previewUrl,omitempty"`
ArtworkURL string `json:"artworkUrl100,omitempty"`
Price float64 `json:"trackPrice,omitempty"`
Currency string `json:"currency,omitempty"`
ReleaseDate string `json:"releaseDate,omitempty"`
Genre string `json:"primaryGenreName,omitempty"`
Country string `json:"country,omitempty"`
TrackCount int `json:"trackCount,omitempty"`
FeedURL string `json:"feedUrl,omitempty"`
}
Result is one item returned by the iTunes API.