Version: v0.0.0-...-57ff362 Latest Latest

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

Go to latest
Published: Oct 10, 2015 License: MIT Imports: 15 Imported by: 0




This section is empty.


This section is empty.


func ArtistUrl

func ArtistUrl(apiKey string, artist string, limit int) string

func BaseApiUrl

func BaseApiUrl(apiKey string, method string, format string, params map[string]string) string

func FetchRequestToken

func FetchRequestToken(config config.ApiConfig) string

func FetchSession

func FetchSession(config config.ApiConfig, token string) string

func Get

func Get(url string) chan []byte

func Post

func Post(params map[string]string) chan []byte

func SessionUrl

func SessionUrl(apiKey string, token string, apiSig string) string

func Signature

func Signature(params map[string]string, apiSecret string) string

func TagUrl

func TagUrl(apiKey string, tag string, limit int) string

func TokenUrl

func TokenUrl(apiKey string, apiSig string) string

func UserUrl

func UserUrl(apiKey string, user string, limit int, period string) string


type Artist

type Artist struct {
	Name       string `json:"name"`
	Mbid       string `json:"mbid"`
	URL        string `json:"url"`
	Streamable string `json:"streamable"`
	Image      []struct {
		Text string `json:"#text"`
		Size string `json:"size"`
	} `json:"image"`
	Attr struct {
		Rank string `json:"rank"`
	} `json:"@attr"`

type ArtistResponse

type ArtistResponse struct {
	Topartists struct {
		Artists []Artist `json:"artist"`
		Attr    struct {
			Tag string `json:"tag"`
		} `json:"@attr"`
	} `json:"topartists"`

func ToArtists

func ToArtists(httpBody []byte) ArtistResponse

func (ArtistResponse) ToString

func (t ArtistResponse) ToString() string

type Playlist

type Playlist struct {
	Id    string `xml:"id"`
	Title string `xml:"title"`
	Url   string `xml:"url"`

type PlaylistSaveResponse

type PlaylistSaveResponse struct {
	Playlists struct {
		PlaylistValue Playlist `xml:"playlist"`
	} `xml:"playlists"`

func ToPlaylist

func ToPlaylist(httpBody []byte) PlaylistSaveResponse

func (PlaylistSaveResponse) ToString

func (t PlaylistSaveResponse) ToString() string

type Response

type Response interface {
	ToString() string

type SessionResponse

type SessionResponse struct {
	Session struct {
		Name       string `json:"name"`
		Key        string `json:"key"`
		Subscriber string `json:"subscriber"`
	} `json:"session"`

func ToSession

func ToSession(httpBody []byte) SessionResponse

func (SessionResponse) ToString

func (t SessionResponse) ToString() string

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`

func ToToken

func ToToken(httpBody []byte) TokenResponse

func (TokenResponse) ToString

func (t TokenResponse) ToString() string

type Track

type Track struct {
	Name       string `json:"name"`
	Duration   string `json:"duration"`
	Playcount  string `json:"playcount"`
	Listeners  string `json:"listeners"`
	Mbid       string `json:"mbid"`
	URL        string `json:"url"`
	Streamable struct {
		Text      string `json:"#text"`
		Fulltrack string `json:"fulltrack"`
	} `json:"streamable"`
	Artist struct {
		Name string `json:"name"`
	} `json:"artist"`
	Image []struct {
		Text string `json:"#text"`
		Size string `json:"size"`
	} `json:"image"`
	Attr struct {
		Rank string `json:"rank"`
	} `json:"@attr"`

type TracksResponse

type TracksResponse struct {
	Toptracks struct {
		Tracks []Track `json:"track"`
		Attr   struct {
			Artist     string `json:"artist"`
			Page       string `json:"page"`
			Perpage    string `json:"perPage"`
			Totalpages string `json:"totalPages"`
			Total      string `json:"total"`
		} `json:"@attr"`
	} `json:"toptracks"`

generated by

func ToTracks

func ToTracks(httpBody []byte) TracksResponse

func (TracksResponse) ToString

func (t TracksResponse) ToString() string

Jump to

Keyboard shortcuts

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