Documentation ¶
Index ¶
- Variables
- type Core
- func (c *Core) AddSourceContents(ctx context.Context, source *model.Source, items []*gofeed.Item) ([]*model.Content, error)
- func (c *Core) AddSubscription(ctx context.Context, userID int64, sourceID uint) error
- func (c *Core) ClearSourceErrorCount(ctx context.Context, sourceID uint) error
- func (c *Core) ContentHashIDExist(ctx context.Context, hashID string) (bool, error)
- func (c *Core) CreateSource(ctx context.Context, sourceURL string) (*model.Source, error)
- func (c *Core) DisableSourceUpdate(ctx context.Context, sourceID uint) error
- func (c *Core) EnableSourceUpdate(ctx context.Context, sourceID uint) error
- func (c *Core) FeedParser() *feed.FeedParser
- func (c *Core) GetSource(ctx context.Context, id uint) (*model.Source, error)
- func (c *Core) GetSourceAllSubscriptions(ctx context.Context, sourceID uint) ([]*model.Subscribe, error)
- func (c *Core) GetSourceByURL(ctx context.Context, sourceURL string) (*model.Source, error)
- func (c *Core) GetSources(ctx context.Context) ([]*model.Source, error)
- func (c *Core) GetSubscription(ctx context.Context, userID int64, sourceID uint) (*model.Subscribe, error)
- func (c *Core) GetUserSubscribedSources(ctx context.Context, userID int64) ([]*model.Source, error)
- func (c *Core) HttpClient() *client.HttpClient
- func (c *Core) Init() error
- func (c *Core) SetSubscriptionInterval(ctx context.Context, userID int64, sourceID uint, interval int) error
- func (c *Core) SetSubscriptionTag(ctx context.Context, userID int64, sourceID uint, tags []string) error
- func (c *Core) SourceErrorCountIncr(ctx context.Context, sourceID uint) error
- func (c *Core) ToggleSourceUpdateStatus(ctx context.Context, sourceID uint) error
- func (c *Core) ToggleSubscriptionNotice(ctx context.Context, userID int64, sourceID uint) error
- func (c *Core) ToggleSubscriptionTelegraph(ctx context.Context, userID int64, sourceID uint) error
- func (c *Core) Unsubscribe(ctx context.Context, userID int64, sourceID uint) error
- func (c *Core) UnsubscribeAllSource(ctx context.Context, userID int64) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func NewCore ¶
func NewCore( userStorage storage.User, contentStorage storage.Content, sourceStorage storage.Source, subscriptionStorage storage.Subscription, parser *feed.FeedParser, httpClient *client.HttpClient, ) *Core
func NewCoreFormConfig ¶
func NewCoreFormConfig() *Core
func (*Core) AddSourceContents ¶
func (*Core) AddSubscription ¶
AddSubscription 添加订阅
func (*Core) ClearSourceErrorCount ¶
ClearSourceErrorCount 清空订阅源错误计数
func (*Core) ContentHashIDExist ¶
func (*Core) CreateSource ¶
CreateSource 创建订阅源
func (*Core) DisableSourceUpdate ¶
DisableSourceUpdate 关闭订阅源更新
func (*Core) EnableSourceUpdate ¶
EnableSourceUpdate 开启订阅源更新
func (*Core) FeedParser ¶
func (c *Core) FeedParser() *feed.FeedParser
func (*Core) GetSourceAllSubscriptions ¶
func (*Core) GetSourceByURL ¶
GetSourceByURL 获取用户订阅的订阅源
func (*Core) GetSources ¶
GetSource 获取用户订阅的订阅源
func (*Core) GetSubscription ¶
func (c *Core) GetSubscription(ctx context.Context, userID int64, sourceID uint) (*model.Subscribe, error)
GetSubscription 获取订阅
func (*Core) GetUserSubscribedSources ¶
GetUserSubscribedSources 获取用户订阅的订阅源
func (*Core) HttpClient ¶
func (c *Core) HttpClient() *client.HttpClient
func (*Core) SetSubscriptionInterval ¶
func (c *Core) SetSubscriptionInterval(ctx context.Context, userID int64, sourceID uint, interval int) error
SetSubscriptionInterval
func (*Core) SetSubscriptionTag ¶
func (c *Core) SetSubscriptionTag(ctx context.Context, userID int64, sourceID uint, tags []string) error
SetSubscriptionTag 设置订阅标签
func (*Core) SourceErrorCountIncr ¶
SourceErrorCountIncr 增加订阅源错误计数
func (*Core) ToggleSourceUpdateStatus ¶
func (*Core) ToggleSubscriptionNotice ¶
func (*Core) ToggleSubscriptionTelegraph ¶
func (*Core) Unsubscribe ¶
Unsubscribe 添加订阅
Click to show internal directories.
Click to hide internal directories.