Versions in this module Expand all Collapse all v1 v1.5.0 Nov 22, 2021 Changes in this version type THSeasonEpisodeCache + SeasonID int v1.4.0 Nov 21, 2021 Changes in this version type Database + func (db *Database) GetTHSeasonEpisodeCache(episodeID int, isVIP bool) (*THSeasonCache, error) + func (db *Database) InsertOrUpdateTHSeasonEpisodeCache(episodeID int, isVIP bool, jsonData string) (int64, error) type THSeasonCache + IsVip *bool + type THSeasonEpisodeCache struct + CreatedAt time.Time + EpisodeID int + IsVip *bool + JSONData string + UpdatedAt time.Time v1.3.0 Nov 20, 2021 v1.2.1 Oct 28, 2021 v1.2.0 Oct 24, 2021 v1.1.0 Oct 17, 2021 v1.0.0 Oct 13, 2021 Changes in this version + type AccessKeys struct + CreatedAt time.Time + Key string + UID int + UpdatedAt time.Time + type Area int + const AreaCN + const AreaHK + const AreaNone + const AreaTH + const AreaTW + type Config struct + DBName string + Host string + Password string + Port int + User string + type Database struct + func NewDBConnection(c *Config) (*Database, error) + func (db *Database) CleanupAccessKeys(duration time.Duration) (int64, error) + func (db *Database) CleanupPlayURLCache(duration time.Duration) (int64, error) + func (db *Database) CleanupTHSeasonCache(duration time.Duration) (int64, error) + func (db *Database) CleanupTHSubtitleCache(duration time.Duration) (int64, error) + func (db *Database) CleanupUsers(duration time.Duration) (int64, error) + func (db *Database) GetKey(key string) (*AccessKeys, error) + func (db *Database) GetPlayURLCache(deviceType DeviceType, area Area, isVIP bool, cid int, episodeID int) (*PlayURLCache, error) + func (db *Database) GetTHSeasonCache(seasonID int) (*THSeasonCache, error) + func (db *Database) GetTHSubtitleCache(episodeID int) (*THSubtitleCache, error) + func (db *Database) GetUser(uid int) (*Users, error) + func (db *Database) InsertOrUpdateKey(key string, uid int) (int64, error) + func (db *Database) InsertOrUpdatePlayURLCache(deviceType DeviceType, area Area, isVIP bool, cid int, episodeID int, ...) (int64, error) + func (db *Database) InsertOrUpdateTHSeasonCache(seasonID int, jsonData string) (int64, error) + func (db *Database) InsertOrUpdateTHSubtitleCache(episodeID int, jsonData string) (int64, error) + func (db *Database) InsertOrUpdateUser(uid int, name string, vipDueDate time.Time) (int64, error) + type DeviceType int + const DeviceTypeAndroid + const DeviceTypeWeb + type PlayURLCache struct + Area Area + CID int + CreatedAt time.Time + DeviceType DeviceType + EpisodeID int + ID uint + IsVip bool + JSONData string + UpdatedAt time.Time + type THSeasonCache struct + CreatedAt time.Time + JSONData string + SeasonID int + UpdatedAt time.Time + type THSubtitleCache struct + CreatedAt time.Time + EpisodeID int + JSONData string + UpdatedAt time.Time + type Users struct + CreatedAt time.Time + Name string + UID int + UpdatedAt time.Time + VIPDueDate time.Time