Documentation ¶
Index ¶
- Constants
- Variables
- type Database
- type HistoriesDB
- type History
- type Playlist
- type PlaylistId
- type PlaylistIds
- type PlaylistLinkPublic
- type PlaylistsDB
- func (playlistsDB *PlaylistsDB) AddIdToPlaylist(playlistId PlaylistId) error
- func (playlistsDB *PlaylistsDB) CreatePlaylist(playlist Playlist) error
- func (playlistsDB *PlaylistsDB) DeleteIdFromPlaylist(playlistId PlaylistId) error
- func (playlistsDB *PlaylistsDB) DeletePlaylist(playlist Playlist) error
- func (playlistsDB *PlaylistsDB) GetPlaylistIds(playlist Playlist) ([]string, error)
- func (playlistsDB *PlaylistsDB) GetPlaylists(apiKey string, publicOnly bool) ([]Playlist, error)
- func (playlistsDB *PlaylistsDB) IsPlaylistPublic(playlist Playlist) bool
- func (playlistsDB *PlaylistsDB) SetPlaylistIds(playlistIds PlaylistIds) error
- func (playlistsDB *PlaylistsDB) SetPublic(playlist Playlist) error
- type User
- type UsersDB
- func (usersDB *UsersDB) AddUser(user User) (User, int)
- func (usersDB *UsersDB) DeleteAllNonVerifiedUsers(request User) error
- func (usersDB *UsersDB) DeleteUser(request User) error
- func (usersDB *UsersDB) FindUserByApiKey(apiKey string) (User, error)
- func (usersDB *UsersDB) FindUserByName(name string) (User, error)
- func (usersDB *UsersDB) GetUserWithPassword(name, password string) (User, int)
- func (usersDB *UsersDB) ListUsers(page int) ([]User, error)
- func (usersDB *UsersDB) ResetPasswordUser(request User) error
- func (usersDB *UsersDB) SetVerificationUser(request User) error
- type YouTubeDB
- type Youtube
- type YoutubeChart
- type YoutubeChartContents
- type YoutubeChartMusicAnalyticsSectionRenderer
- type YoutubeChartMusicAnalyticsSectionRendererContent
- type YoutubeChartSectionListRenderer
- type YoutubeChartSectionListRendererContent
- type YoutubeChartThumbnail
- type YoutubeChartThumbnailDetails
- type YoutubeChartVideo
- type YoutubeChartVideoView
- type YoutubeContentDetails
- type YoutubeId
- type YoutubeItem
- type YoutubeResponse
- type YoutubeSearch
- type YoutubeSearchResult
- type YoutubeSnippet
- type YoutubeSong
- type YoutubeSongReader
- type YoutubeThumbnail
- type YoutubeThumbnails
Constants ¶
View Source
const TableHistories = "histories"
View Source
const TablePlaylists = "playlists"
View Source
const TableUsers = "users"
Variables ¶
View Source
var ColumnAdmin = column{"admin", boolean()}
View Source
var ColumnApikey = column{"api_key", text()}
View Source
var ColumnDate = column{"date", datetime()}
View Source
var ColumnId = column{"id", text()}
View Source
var ColumnIds = column{"ids", text()}
View Source
var ColumnName = column{"name", text()}
View Source
var ColumnPasswordHash = column{"password_hash", text()}
View Source
var ColumnPasswordSalt = column{"password_salt", text()}
View Source
var ColumnPublic = column{"public", boolean()}
View Source
var ColumnVerified = column{"verified", boolean()}
View Source
var ForeignKeyApikey = foreignKey{ColumnApikey.name, text(), TableUsers, ColumnApikey.name, true}
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { UsersDB *UsersDB PlaylistsDB *PlaylistsDB HistoriesDB *HistoriesDB YoutubeDB YouTubeDB // contains filtered or unexported fields }
func GetDatabase ¶
func GetDefaultDatabase ¶
func GetDefaultDatabase() *Database
type HistoriesDB ¶
type HistoriesDB struct {
// contains filtered or unexported fields
}
func (*HistoriesDB) AddHistory ¶
func (historiesDB *HistoriesDB) AddHistory(apiKey, id string) error
func (*HistoriesDB) GetHistory ¶
func (historiesDB *HistoriesDB) GetHistory(apiKey string) ([]string, error)
type History ¶
type History struct { ApiKey string `json:"apikey"` Id string `json:"id"` Date time.Time `json:"-"` }
func NewHistory ¶
type Playlist ¶
type Playlist struct { ApiKey string `json:"apikey,omitempty"` Name string `json:"name"` Public bool `json:"public"` }
func NewPlaylist ¶
type PlaylistId ¶
type PlaylistId struct { ApiKey string `json:"apikey,omitempty"` Name string `json:"name"` Id string `json:"id"` }
func NewPlaylistId ¶
func NewPlaylistId(data []byte) (PlaylistId, error)
type PlaylistIds ¶
type PlaylistIds struct { ApiKey string `json:"apikey,omitempty"` Name string `json:"name"` Ids []string `json:"ids"` }
func NewPlaylistIds ¶
func NewPlaylistIds(data []byte) (PlaylistIds, error)
type PlaylistLinkPublic ¶
type PlaylistLinkPublic struct { ApiKey string `json:"apikey,omitempty"` Name string `json:"name"` Playlist string `json:"playlist"` }
func NewPlaylistPublic ¶
func NewPlaylistPublic(data []byte) (PlaylistLinkPublic, error)
type PlaylistsDB ¶
type PlaylistsDB struct {
// contains filtered or unexported fields
}
func (*PlaylistsDB) AddIdToPlaylist ¶
func (playlistsDB *PlaylistsDB) AddIdToPlaylist(playlistId PlaylistId) error
func (*PlaylistsDB) CreatePlaylist ¶
func (playlistsDB *PlaylistsDB) CreatePlaylist(playlist Playlist) error
func (*PlaylistsDB) DeleteIdFromPlaylist ¶
func (playlistsDB *PlaylistsDB) DeleteIdFromPlaylist(playlistId PlaylistId) error
func (*PlaylistsDB) DeletePlaylist ¶
func (playlistsDB *PlaylistsDB) DeletePlaylist(playlist Playlist) error
func (*PlaylistsDB) GetPlaylistIds ¶
func (playlistsDB *PlaylistsDB) GetPlaylistIds(playlist Playlist) ([]string, error)
func (*PlaylistsDB) GetPlaylists ¶
func (playlistsDB *PlaylistsDB) GetPlaylists(apiKey string, publicOnly bool) ([]Playlist, error)
func (*PlaylistsDB) IsPlaylistPublic ¶
func (playlistsDB *PlaylistsDB) IsPlaylistPublic(playlist Playlist) bool
func (*PlaylistsDB) SetPlaylistIds ¶
func (playlistsDB *PlaylistsDB) SetPlaylistIds(playlistIds PlaylistIds) error
func (*PlaylistsDB) SetPublic ¶
func (playlistsDB *PlaylistsDB) SetPublic(playlist Playlist) error
type User ¶
type UsersDB ¶
type UsersDB struct {
// contains filtered or unexported fields
}
func (*UsersDB) DeleteAllNonVerifiedUsers ¶
func (*UsersDB) DeleteUser ¶
func (*UsersDB) FindUserByApiKey ¶
func (*UsersDB) GetUserWithPassword ¶
func (*UsersDB) ResetPasswordUser ¶
func (*UsersDB) SetVerificationUser ¶
type YouTubeDB ¶
type YouTubeDB interface { GetYoutubeSong(id string) (*YoutubeSong, error) FetchYoutubeSong(id string) (string, string, error) GetYoutubeSearch(searchQuery string) ([]YoutubeSearchResult, error) GetYoutubeInfo(id string) (YoutubeSearchResult, error) GetYoutubeCharts() ([]YoutubeSearchResult, error) }
type Youtube ¶
type Youtube struct { ApiKey string `json:"apikey"` SearchQuery string `json:"searchquery"` Id string `json:"id"` AddHistory bool `json:"addhistory"` }
func NewYoutube ¶
type YoutubeChart ¶
type YoutubeChart struct {
Contents YoutubeChartContents `json:"contents"`
}
type YoutubeChartContents ¶
type YoutubeChartContents struct {
SectionListRenderer YoutubeChartSectionListRenderer `json:"sectionListRenderer"`
}
type YoutubeChartMusicAnalyticsSectionRenderer ¶
type YoutubeChartMusicAnalyticsSectionRenderer struct {
Content YoutubeChartMusicAnalyticsSectionRendererContent `json:"content"`
}
type YoutubeChartMusicAnalyticsSectionRendererContent ¶
type YoutubeChartMusicAnalyticsSectionRendererContent struct {
Videos []YoutubeChartVideo `json:"videos"`
}
type YoutubeChartSectionListRenderer ¶
type YoutubeChartSectionListRenderer struct {
Contents []YoutubeChartSectionListRendererContent `json:"contents"`
}
type YoutubeChartSectionListRendererContent ¶
type YoutubeChartSectionListRendererContent struct {
MusicAnalyticsSectionRenderer YoutubeChartMusicAnalyticsSectionRenderer `json:"musicAnalyticsSectionRenderer"`
}
type YoutubeChartThumbnail ¶
type YoutubeChartThumbnail struct {
Details []YoutubeChartThumbnailDetails `json:"thumbnails"`
}
type YoutubeChartThumbnailDetails ¶
type YoutubeChartThumbnailDetails struct {
Url string `json:"url"`
}
type YoutubeChartVideo ¶
type YoutubeChartVideo struct { ListType string `json:"listType"` VideoViews []YoutubeChartVideoView `json:"videoViews"` }
type YoutubeChartVideoView ¶
type YoutubeChartVideoView struct { Id string `json:"id"` Title string `json:"title"` Thumbnail YoutubeChartThumbnail `json:"thumbnail"` Duration int `json:"videoDuration"` }
type YoutubeContentDetails ¶
type YoutubeContentDetails struct {
Duration string `json:"duration"`
}
type YoutubeId ¶
type YoutubeId struct {
// contains filtered or unexported fields
}
func (YoutubeId) GetUniqueId ¶
type YoutubeItem ¶
type YoutubeItem struct { Snippet YoutubeSnippet `json:"snippet"` ContentDetails YoutubeContentDetails `json:"contentDetails"` Id string `json:"id"` }
type YoutubeResponse ¶
type YoutubeResponse struct {
Items []YoutubeItem `json:"items"`
}
type YoutubeSearch ¶
type YoutubeSearch struct {
// contains filtered or unexported fields
}
func (YoutubeSearch) GetCount ¶
func (youtubeSearch YoutubeSearch) GetCount() int
func (YoutubeSearch) GetUniqueId ¶
func (youtubeSearch YoutubeSearch) GetUniqueId() string
type YoutubeSearchResult ¶
type YoutubeSnippet ¶
type YoutubeSnippet struct { Title string `json:"title"` Thumbnails YoutubeThumbnails `json:"thumbnails"` }
type YoutubeSong ¶
type YoutubeSong struct {
// contains filtered or unexported fields
}
func (YoutubeSong) GetCount ¶
func (youtubeSong YoutubeSong) GetCount() int
func (YoutubeSong) GetUniqueId ¶
func (youtubeSong YoutubeSong) GetUniqueId() string
func (*YoutubeSong) IsDownloading ¶
func (youtubeSong *YoutubeSong) IsDownloading() bool
func (*YoutubeSong) Reader ¶
func (youtubeSong *YoutubeSong) Reader() (*YoutubeSongReader, error)
type YoutubeSongReader ¶
func (*YoutubeSongReader) Close ¶
func (youtubeSongReader *YoutubeSongReader) Close() error
func (*YoutubeSongReader) ReadAt ¶
func (youtubeSongReader *YoutubeSongReader) ReadAt(p []byte, off int64) (n int, err error)
func (*YoutubeSongReader) Size ¶
func (youtubeSongReader *YoutubeSongReader) Size() int64
type YoutubeThumbnail ¶
type YoutubeThumbnail struct {
Url string `json:"url"`
}
type YoutubeThumbnails ¶
type YoutubeThumbnails struct {
Medium YoutubeThumbnail `json:"medium"`
}
Click to show internal directories.
Click to hide internal directories.