Documentation ¶
Index ¶
- type ConnectionInfo
- type Database
- type Download
- type DownloadTable
- type Log
- type LogTable
- type LogType
- type Subscription
- type SubscriptionTable
- type Table
- type Version
- type VersionTable
- type Video
- type VideoStatusType
- type VideosTable
- func (v VideosTable) Delete(id string) error
- func (v VideosTable) Exists(videoID string) (bool, error)
- func (v VideosTable) Get(id string) (Video, error)
- func (v VideosTable) GetStatus(videoID string) (int, error)
- func (v VideosTable) GetVideos(failed, savedView bool) ([]Video, error)
- func (v VideosTable) Insert(id string, subscriptionID string, title string, duration string, ...) error
- func (v VideosTable) Search(text string) ([]Video, error)
- func (v VideosTable) UpdateDuration(videoID string, duration string) error
- func (v VideosTable) UpdateSave(id string, saved bool) error
- func (v VideosTable) UpdateStatus(id string, status VideoStatusType) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionInfo ¶
type ConnectionInfo struct { Server string Port int Database string Username string Password string }
func (*ConnectionInfo) String ¶
func (c *ConnectionInfo) String() string
getConnectionString : Returns the connections string
type Database ¶
type Database struct { ConnectionInfo Connection *sql.DB Subscriptions *SubscriptionTable Videos *VideosTable Version *VersionTable Download *DownloadTable Log *LogTable }
Database : A connection to the SoftTube database
func NewDatabase ¶
NewDatabase : Creates a new database object
type DownloadTable ¶
type DownloadTable struct {
*Table
}
DownloadTable : VideosTable in the SoftTube database
func (DownloadTable) Delete ¶
func (d DownloadTable) Delete(id string) error
Delete : Deletes the row from the downloaded list
func (DownloadTable) GetAll ¶
func (d DownloadTable) GetAll() ([]Download, error)
GetAll : Returns all download requests
func (DownloadTable) Insert ¶
func (d DownloadTable) Insert(id string) error
Insert : Insert a new download request into the database
type LogTable ¶
type LogTable struct {
*Table
}
LogTable : The version table in the database
type Subscription ¶
type Subscription struct { ID string Name string Frequency int LastChecked sql.NullTime NextUpdate sql.NullInt32 }
Subscription : Represents a YouTube subscription in SoftTube
func (Subscription) NeedsUpdate ¶
func (s Subscription) NeedsUpdate() bool
NeedsUpdate : Does the subscription need an update?
type SubscriptionTable ¶
type SubscriptionTable struct {
*Table
}
SubscriptionTable : SubscriptionTable in the SoftTube database
func (SubscriptionTable) Get ¶
func (s SubscriptionTable) Get(id string) (Subscription, error)
Get : Returns a subscription
func (SubscriptionTable) GetAll ¶
func (s SubscriptionTable) GetAll() ([]Subscription, error)
GetAll : Returns all subscriptions
func (SubscriptionTable) UpdateLastChecked ¶
func (s SubscriptionTable) UpdateLastChecked(subscription *Subscription, interval int) error
UpdateLastChecked : Update last_checked and next_update for a subscription
type VersionTable ¶
type VersionTable struct {
*Table
}
VersionTable : The version table in the database
func (VersionTable) Get ¶
func (v VersionTable) Get() (Version, error)
Get : Get the version number of a SoftTube database
type Video ¶
type Video struct { ID string SubscriptionID string SubscriptionName string Title string Added time.Time Published time.Time Duration sql.NullString Status VideoStatusType Saved bool }
Video : Represents a YouTube video in SoftTube
type VideoStatusType ¶
type VideoStatusType int
type VideosTable ¶
type VideosTable struct {
*Table
}
VideosTable : VideosTable in the SoftTube database
func (VideosTable) Delete ¶
func (v VideosTable) Delete(id string) error
Delete : Delete a video from the database
func (VideosTable) Exists ¶
func (v VideosTable) Exists(videoID string) (bool, error)
Exists : Does a video already exist in the database?
func (VideosTable) Get ¶
func (v VideosTable) Get(id string) (Video, error)
Get : Returns a subscription
func (VideosTable) GetStatus ¶
func (v VideosTable) GetStatus(videoID string) (int, error)
GetStatus : Get the video status
func (VideosTable) GetVideos ¶
func (v VideosTable) GetVideos(failed, savedView bool) ([]Video, error)
GetVideos : Gets a list of the latest videos
func (VideosTable) Insert ¶
func (v VideosTable) Insert( id string, subscriptionID string, title string, duration string, published time.Time, ) error
Insert : Insert a new video into the database
func (VideosTable) Search ¶
func (v VideosTable) Search(text string) ([]Video, error)
Search : Searches for videos
func (VideosTable) UpdateDuration ¶
func (v VideosTable) UpdateDuration(videoID string, duration string) error
UpdateDuration : Update duration for a video
func (VideosTable) UpdateSave ¶
func (v VideosTable) UpdateSave(id string, saved bool) error
UpdateSave : Update saved flag for a video
func (VideosTable) UpdateStatus ¶
func (v VideosTable) UpdateStatus(id string, status VideoStatusType) error
UpdateStatus : Update the status for a video