Documentation
¶
Index ¶
- Variables
- func CloseDB() error
- func GetDB() (*sql.DB, error)
- func GetDatabasePath() (string, error)
- func GetSetting(key string) (string, error)
- func LogDebug(message string, args ...interface{})
- func SetSetting(key, value string) error
- func StoreChannel(channel Channel) error
- func StoreVideos(channelID string, videos []Video) error
- func UpdateVideoFileSize(videoID string, fileSize int64) error
- type Channel
- type Links
- type ShowInfo
- type Video
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Global database instance DB *sql.DB )
Functions ¶
func GetDatabasePath ¶
GetDatabasePath returns the path where the database is stored
func GetSetting ¶
GetSetting retrieves a setting value by key
func LogDebug ¶
func LogDebug(message string, args ...interface{})
LogDebug prints debug messages when in development mode
func StoreChannel ¶
StoreChannel stores a channel in the database
func StoreVideos ¶
StoreVideos stores multiple videos in the database
func UpdateVideoFileSize ¶
UpdateVideoFileSize updates the file_size for a video in the database
Types ¶
type Channel ¶
type Channel struct {
ID string `json:"_id"`
Title string `json:"title"`
Summary string `json:"summary,omitempty"`
TextInfo string `json:"textInfo,omitempty"`
Avatar string `json:"avatar,omitempty"`
CoverImage string `json:"coverImage,omitempty"`
IsLive bool `json:"isLive,omitempty"`
TotalVideos float64 `json:"totalVideos,omitempty"`
TotalVideoViews float64 `json:"totalVideoViews,omitempty"`
TotalLikes float64 `json:"totalLikes,omitempty"`
Videos []Video `json:"videos,omitempty"`
ShowInfo *ShowInfo `json:"showInfo,omitempty"`
Links *Links `json:"links,omitempty"`
}
Channel represents a channel structure
func GetAllChannels ¶
GetAllChannels retrieves all channels from the database
type Video ¶
type Video struct {
ID string `json:"_id"`
Title string `json:"title"`
Summary string `json:"summary"`
LargeImage string `json:"largeImage"`
VideoDuration float64 `json:"videoDuration"`
CreatedAt string `json:"createdAt"`
DirectURL string `json:"directUrl"`
PlayCount int `json:"playCount,omitempty"`
LikeCount int `json:"likeCount,omitempty"`
AngerCount int `json:"angerCount,omitempty"`
EmbedURL string `json:"embedUrl,omitempty"`
Published bool `json:"published,omitempty"`
FileSize int64 `json:"fileSize,omitempty"`
}
Video represents a video structure
Click to show internal directories.
Click to hide internal directories.