Versions in this module Expand all Collapse all v0 v0.8.4 Feb 19, 2022 Changes in this version + const MaxSubscribeTagLength + func ActiveSourcesByUserID(userID int64) error + func DeleteContentsBySourceID(sid uint) + func Disconnect() + func InitDB() + func PauseSourcesByUserID(userID int64) error + func ProcessWechatURL(urlStr string) string + func PublishItem(source *Source, item *rss.Item, html string) string + func RegistFeed(userID int64, sourceID uint) error + func UnsubAllByUserID(userID int64) (success int, fail int, err error) + func UnsubByUserIDAndSource(userID int64, source *Source) error + func UnsubByUserIDAndSourceURL(userID int64, url string) error + func UnsubByUserIDAndSubID(userID int64, subID uint) error + type Content struct + Description string + HashID string + RawID string + RawLink string + SourceID uint + TelegraphURL string + Title string + func GenContentAndCheckByFeedItem(s *Source, item *rss.Item) (*Content, bool, error) + type EditTime struct + CreatedAt time.Time + UpdatedAt time.Time + type Option struct + ID int + Name string + Value string + type Source struct + Content []Content + ErrorCount uint + ID uint + Link string + Title string + func FindOrNewSourceByUrl(url string) (*Source, error) + func GetErrorSourcesByUserID(userID int64) ([]Source, error) + func GetSourceById(id uint) (*Source, error) + func GetSourceByUrl(url string) (*Source, error) + func GetSources() (sources []*Source) + func GetSourcesByUserID(userID int64) ([]Source, error) + func GetSubscribedNormalSources() []*Source + func (s *Source) AddErrorCount() + func (s *Source) DeleteContents() + func (s *Source) DeleteDueNoSubscriber() + func (s *Source) EraseErrorCount() + func (s *Source) GetNewContents() ([]*Content, error) + func (s *Source) GetSubscribeNum() int + func (s *Source) IsSubscribed() bool + func (s *Source) NeedUpdate() bool + func (s *Source) Save() + func (s *Source) ToggleEnabled() error + type Subscribe struct + EnableNotification int + EnableTelegraph int + ID uint + Interval int + SourceID uint + Tag string + UserID int64 + WaitTime int + func GetSubByUserIDAndURL(userID int64, url string) (*Subscribe, error) + func GetSubsByUserID(userID int64) ([]Subscribe, error) + func GetSubscribeByID(id int) (*Subscribe, error) + func GetSubscribeByUserIDAndSourceID(userID int64, sourceID uint) (*Subscribe, error) + func GetSubscribeByUserIDAndURL(userID int, url string) (*Subscribe, error) + func GetSubscriberBySource(s *Source) []*Subscribe + func (s *Subscribe) Save() + func (s *Subscribe) SetInterval(interval int) error + func (s *Subscribe) SetTag(tags []string) error + func (s *Subscribe) ToggleNotification() error + func (s *Subscribe) ToggleTelegraph() error + func (s *Subscribe) Unsub() error + type User struct + ID int64 + Source []Source + State int + TelegramID int64 + func FindOrCreateUserByTelegramID(telegramID int64) (*User, error) + func FindOrInitUser(userID int64) (*User, error) + func (user *User) GetSubSourceMap() (map[Subscribe]Source, error)