musicservice

package
v0.0.0-...-bef9589 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2017 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const API_KEY = "AIzaSyCbfxhEDNKXXPFbmjttsqFvGHxjvTlfVxg"

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error)

Types

type LibSong

type LibSong struct {
	Videoid string `json:"videoid"`
	Track   string `json:"track"`
	Fav     bool   `json:"fav"`
	Source  string `json:"source"`
}

type Playlist

type Playlist []Song

func (Playlist) Len

func (s Playlist) Len() int

func (Playlist) Less

func (s Playlist) Less(i, j int) bool

func (Playlist) Swap

func (s Playlist) Swap(i, j int)

type Song

type Song struct {
	Id        int      `json:"id"`
	Videoid   string   `json:"videoid"`
	Name      string   `json:"name"`
	Length    int      `json:"length"`
	Seek      int      `json:"seek"`
	AddedBy   string   `json:"added_by"`
	Thumbnail string   `json:"thumbnail"`
	Details   SongInfo `json:"details"`
}

func CreateSong

func CreateSong(videoid string) Song

func Recommend

func Recommend(s Song) Song

func RecommendMulti

func RecommendMulti(videoid string) []Song
func Search(query string) []Song

func (*Song) Score

func (s *Song) Score() float64

type SongInfo

type SongInfo struct {
	Name       string
	Duration   int
	Thumbnail  string
	Views      int
	Likes      int
	Dislikes   int
	Favourites int
	Comments   int
}

func GetInfo

func GetInfo(videoid string) SongInfo

type User

type User struct {
	Name string `json:"name"`
	Id   string `json:"id"`
}

Jump to

Keyboard shortcuts

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