Documentation ¶
Index ¶
- func CreateKeywordsRelation(playlistID int, wordList []Keyword) error
- func CreateSession(s Session) error
- func CreateVideosFromPlaylist(playlistID int, vs []Video) error
- func DeleteSessionBySessionID(sessionID string) error
- func DeleteVideo(v Video) bool
- type Auth
- type Error
- type Keyword
- type Playlist
- type Session
- type Video
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKeywordsRelation ¶
CreateKeywordsRelation Execute one single SQL instruction relating existing keywords from the database with a unique Playlist.
func CreateSession ¶
CreateSession stores in the database the created session for further database validation
func CreateVideosFromPlaylist ¶
CreateVideosFromPlaylist insert into the database all the videos inserted with the playlist. Returns only nil or the error received from the database.
func DeleteSessionBySessionID ¶
DeleteSessionBySessionID erase from the database the Session by it's session ID string.
func DeleteVideo ¶
DeleteVideo deletes a video from the database. For it to work, it must be part of a specific playlist. Returns ok if entry was found and deleted without problems.
Types ¶
type Auth ¶
type Auth struct { PlaylistID int `json:"playlistid,omitempty"` PublicID string `json:"publicid,omitempty"` Passphrase string `json:"passphrase,omitempty"` }
Auth type holds the information given by the user to authenticate into a specific playlist.
type Keyword ¶
Keyword represent a single keyword database object with his own ID.
func CreateKeyword ¶
CreateKeyword creates a new keyword in the database if it doesn't exist already. If exists, returns the word itself from the database.
func GetKeywordsByID ¶
GetKeywordsByID Given a slice of id's, this will return a list a keywords with all keyword from such slice.
func GetKeywordsByPartialWord ¶
GetKeywordsByPartialWord returns a list of keyword with a maximum amount of 10.
func GetKeywordsByPlaylistID ¶
GetKeywordsByPlaylistID get all keywords that are associated with a given Playlist
type Playlist ¶
type Playlist struct { ID int `json:"id,omitempty"` PublicID string `json:"publicid,omitempty"` Name string `json:"name,omitempty"` IsPublic bool `json:"public,omitempty"` Passphrase string `json:"passphrase,omitempty"` Keywords []Keyword `json:"keywords,omitempty"` Videos []Video `json:"videos,omitempty"` }
Playlist represent a single playlist to be created or reproduced
func CreatePlaylist ¶
CreatePlaylist create a new playlist, either public or private
func GetPlaylistByPublicID ¶
GetPlaylistByPublicID returns a single playlist including all it's videos and keywords.
type Session ¶
Session is the structure of a valid session in the database or cookie
func GetSessionBySessionID ¶
GetSessionBySessionID get the session from their base64 string
type Video ¶
type Video struct { ID int `json:"id,omitempty"` PlaylistID int `json:"playlistid,omitempty"` Name string `json:"name"` Link string `json:"link"` UniqueID string `json:"uniqueid,omitempty"` }
Video refers to a video, which is a part of a playlist
func CreateVideoInPlaylist ¶
CreateVideoInPlaylist Creates a video in the database including it's relation with the playlist to which the video belongs.
func GetVideosByPlaylistID ¶
GetVideosByPlaylistID retrieve all videos that belong to a specific playlist using the id from the database.