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 adds a subscription
func (*Core) ClearSourceErrorCount ¶
ClearSourceErrorCount clears the error count of a source
func (*Core) ContentHashIDExist ¶
func (*Core) CreateSource ¶
CreateSource creates a new source
func (*Core) DisableSourceUpdate ¶
DisableSourceUpdate disables source update for a source
func (*Core) EnableSourceUpdate ¶
EnableSourceUpdate enables source update for a source
func (*Core) FeedParser ¶
func (c *Core) FeedParser() *feed.FeedParser
func (*Core) GetSourceAllSubscriptions ¶
func (*Core) GetSourceByURL ¶
GetSourceByURL gets a subscribed source by URL
func (*Core) GetSources ¶
GetSources gets all subscribed sources
func (*Core) GetSubscription ¶
func (c *Core) GetSubscription(ctx context.Context, userID int64, sourceID uint) (*model.Subscribe, error)
GetSubscription gets a subscription
func (*Core) GetUserSubscribedSources ¶
GetUserSubscribedSources gets the subscribed sources of a user
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 sets the update interval of a subscription
func (*Core) SetSubscriptionTag ¶
func (c *Core) SetSubscriptionTag(ctx context.Context, userID int64, sourceID uint, tags []string) error
SetSubscriptionTag sets the tags of a subscription
func (*Core) SourceErrorCountIncr ¶
SourceErrorCountIncr increments the error count of a source
func (*Core) ToggleSourceUpdateStatus ¶
func (*Core) ToggleSubscriptionNotice ¶
func (*Core) ToggleSubscriptionTelegraph ¶
func (*Core) Unsubscribe ¶
Unsubscribe unsubscribes a user from a source
Click to show internal directories.
Click to hide internal directories.