user

package
v0.0.0-...-5fee3ad Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	Username string
	// contains filtered or unexported fields
}

User represents a structure to help query the `user` LastFM API functions.

func New

func New(client *lastfm.Client, username string) (user *User)

New returns an instance of the `user` API endpoint functions for LastFM.

func (*User) GetFriends

func (u *User) GetFriends(page int) (fi *friendInfo, err error)

GetFriends fetches a list of friends from LastFM

func (*User) GetInfo

func (u *User) GetInfo() (ui *userInfo, err error)

GetInfo fetches user information from LastFM

func (*User) GetLovedTracks

func (u *User) GetLovedTracks(page int) (lt *lovedTracks, err error)

GetLovedTracks fetches tracks loved by the user from LastFM

func (*User) GetPersonalTags

func (u *User) GetPersonalTags(tag string, taggingType string, page int) (pt *personalTags, err error)

GetPersonalTags fetches metadata for the user's user-applied tags from LastFM, for the provided tag and taggingType

taggingType needs to be either of `artist`, `album`, or `track`.

func (*User) GetRecentTracks

func (u *User) GetRecentTracks(extended bool, page int) (rt *recentTracks, err error)

GetRecentTracks fetches a list of recent tracks listened to by the user from LastFM. Includes the current playing track.

func (*User) GetTopAlbums

func (u *User) GetTopAlbums(period string, page int) (ta *topAlbums, err error)

GetTopAlbums fetches a list of top albums listened to by the user from LastFM for the specified period.

func (*User) GetTopArtists

func (u *User) GetTopArtists(period string, page int) (ta *topArtists, err error)

GetTopArtists fetches a list of top artists listened to by the user from LastFM for the specified period.

period needs to be either of `overall`, `7day`, `1month`, `3month`, `6month`, `12month`.

func (*User) GetTopTags

func (u *User) GetTopTags() (tt *topTags, err error)

GetTopTags fetches top tags used by the user on LastFM.

func (*User) GetTopTracks

func (u *User) GetTopTracks(period string, page int) (tt *topTracks, err error)

GetTopTracks fetches a list of top tracks listened to by the user from LastFM for the specified period.

period needs to be either of `overall`, `7day`, `1month`, `3month`, `6month`, `12month`.

func (*User) GetWeeklyAlbumChart

func (u *User) GetWeeklyAlbumChart(from, to int64) (wac *weeklyAlbumChart, err error)

GetWeeklyAlbumChart fetches album chart for the user from LastFM for the given date range (from, to)

from and to need to be the time period for the album chart to fetch in unixtime.

func (*User) GetWeeklyArtistChart

func (u *User) GetWeeklyArtistChart(from, to int64) (wac *weeklyArtistChart, err error)

GetWeeklyArtistChart fetches artist chart for the user from LastFM for the given date range (from, to)

from and to need to be the time period for the artist chart to fetch in unixtime.

func (*User) GetWeeklyChartList

func (u *User) GetWeeklyChartList() (wcl *weeklyChartList, err error)

GetWeeklyChartList fetches a list of available charts for the user from LastFM, expressed as date range (from, to) in unixtime.

func (*User) GetWeeklyTrackChart

func (u *User) GetWeeklyTrackChart(from, to int64) (wtc *weeklyTrackChart, err error)

GetWeeklyTrackChart fetches track chart for the user from LastFM for the given date range (from, to)

from and to need to be the time period for the track chart to fetch in unixtime.

Jump to

Keyboard shortcuts

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