Documentation
¶
Index ¶
- type Client
- func (c *Client) AddFeed(source *FeedSource) (int64, error)
- func (c *Client) AddNews(feedID int64, source *FeedItem) error
- func (c *Client) CheckWhetherSourceExist(url string) (bool, error)
- func (c *Client) DeleteFeedSource(id int64) error
- func (c *Client) GetActiveFeedSources() ([]*FeedSource, error)
- func (c *Client) GetActiveFeedSourcesWithStats() ([]*FeedSourceWithUnread, error)
- func (c *Client) GetAllFeeds() (res []*FeedSource, err error)
- func (c *Client) GetFeedItems(id string) (res []*FeedItem, err error)
- func (c *Client) GetFeedSource(id int64) (*FeedSource, error)
- func (c *Client) GetNewsItem(id int64) (*FeedItem, error)
- func (c *Client) ListFeedItems(id string) error
- func (c *Client) MarkAsRead(newsID int64) error
- func (c *Client) MarkAsReadMulti(newsID []int64) error
- func (c *Client) SearchNews(filters ...Filter) ([]*ExtendedFeedItem, error)
- func (c *Client) UpdateFeedSource(f *FeedSource) error
- type DataPoint
- type DataPointClient
- func (c *DataPointClient) GetDataPoint(newsID int64) (*DataPoint, error)
- func (c *DataPointClient) GetProcessQueue() ([]*ProcessQueue, error)
- func (c *DataPointClient) MarkAsProcessed(q *ProcessQueue, keywords []string) error
- func (c *DataPointClient) PopulateProcessQueue() error
- func (c *DataPointClient) SaveDataPoint(point *DataPoint) error
- type ExtendedFeedItem
- type FeedItem
- type FeedRule
- type FeedRuleClient
- type FeedSource
- type FeedSourceWithUnread
- type Filter
- type FlagItemClient
- type ProcessQueue
- type RuleAction
- type RuleType
- type SavedItem
- type SavedItemClient
- type TagItemClient
- type TaggedItem
- type UserClassification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *FeedRuleClient // contains filtered or unexported fields }
Deprecate this and create multiple clients for each table instead.
func NewSqlite3Client ¶
func (*Client) CheckWhetherSourceExist ¶
func (*Client) DeleteFeedSource ¶
func (*Client) GetActiveFeedSources ¶
func (c *Client) GetActiveFeedSources() ([]*FeedSource, error)
func (*Client) GetActiveFeedSourcesWithStats ¶
func (c *Client) GetActiveFeedSourcesWithStats() ([]*FeedSourceWithUnread, error)
func (*Client) GetAllFeeds ¶
func (c *Client) GetAllFeeds() (res []*FeedSource, err error)
func (*Client) GetFeedSource ¶
func (c *Client) GetFeedSource(id int64) (*FeedSource, error)
func (*Client) ListFeedItems ¶
func (*Client) MarkAsRead ¶
func (*Client) MarkAsReadMulti ¶
func (*Client) SearchNews ¶
func (c *Client) SearchNews(filters ...Filter) ([]*ExtendedFeedItem, error)
func (*Client) UpdateFeedSource ¶
func (c *Client) UpdateFeedSource(f *FeedSource) error
type DataPoint ¶
type DataPoint struct { // auto public key Id int64 NewsItemId int64 `xorm:"index"` Keywords []string Outcome UserClassification }
DataPoint for doing our learning
type DataPointClient ¶
func (*DataPointClient) GetDataPoint ¶
func (c *DataPointClient) GetDataPoint(newsID int64) (*DataPoint, error)
func (*DataPointClient) GetProcessQueue ¶
func (c *DataPointClient) GetProcessQueue() ([]*ProcessQueue, error)
func (*DataPointClient) MarkAsProcessed ¶
func (c *DataPointClient) MarkAsProcessed(q *ProcessQueue, keywords []string) error
func (*DataPointClient) PopulateProcessQueue ¶
func (c *DataPointClient) PopulateProcessQueue() error
look through datapoints and find news feed that is not a point yet.
func (*DataPointClient) SaveDataPoint ¶
func (c *DataPointClient) SaveDataPoint(point *DataPoint) error
type ExtendedFeedItem ¶
type ExtendedFeedItem struct { *FeedItem `xorm:"extends"` IsSaved bool Classification UserClassification }
feedItem with metadata
func (ExtendedFeedItem) TableName ¶
func (ExtendedFeedItem) TableName() string
type FeedItem ¶
type FeedItem struct { // auto public key Id int64 FeedId int64 `xorm:"index"` Read bool `xorm:"index"` Title string `xorm:"index"` Published *time.Time LinkHref string `xorm:"unique"` Description string Content string AuthorName string Category []string `xorm:"index"` Guid string Enclosure string Custom map[string]string }
type FeedRule ¶
type FeedRule struct { FeedId int64 `xorm:"index"` FilterType RuleType FilterAction RuleAction FilterString string }
type FeedRuleClient ¶
func (*FeedRuleClient) AddRegexRule ¶
func (c *FeedRuleClient) AddRegexRule(feedID int64, regex string, action RuleAction) error
func (*FeedRuleClient) GetRules ¶
func (c *FeedRuleClient) GetRules() ([]*FeedRule, error)
type FeedSource ¶
type FeedSourceWithUnread ¶
type FeedSourceWithUnread struct { *FeedSource `xorm:"extends"` UnreadCount int64 TotalCount int64 }
TODO comments
func ListAllFeedsWithStats ¶
func ListAllFeedsWithStats(engine *xorm.Engine) ([]*FeedSourceWithUnread, error)
ListAllFeedsWithStatus returns the feeds along with its stats. Note: This can be quite slow.
func (FeedSourceWithUnread) TableName ¶
func (FeedSourceWithUnread) TableName() string
type Filter ¶
func FilterFeedID ¶
func FilterFeedIds ¶
func FilterGUID ¶
func FilterLimit ¶
func FilterSaved ¶
func FilterSaved() Filter
func FilterUnread ¶
func FilterUnread() Filter
type FlagItemClient ¶
func (*FlagItemClient) FlagItem ¶
func (c *FlagItemClient) FlagItem(newsID int64, feedID int64) (bool, error)
func (*FlagItemClient) GetAllFlagged ¶
func (c *FlagItemClient) GetAllFlagged(feedID int64) ([]int64, error)
func (*FlagItemClient) RemoveFlag ¶
func (c *FlagItemClient) RemoveFlag(newsID int64, feedID int64) (bool, error)
type ProcessQueue ¶
type SavedItemClient ¶
func (*SavedItemClient) RemoveFromSaved ¶
func (c *SavedItemClient) RemoveFromSaved(newsID int64, feedID int64) error
func (*SavedItemClient) Save ¶
func (c *SavedItemClient) Save(newsID int64, feedID int64) error
Save does nothing if the item is already saved.
func (*SavedItemClient) ToggleSave ¶
func (c *SavedItemClient) ToggleSave(newsID int64, feedID int64) (bool, error)
type TagItemClient ¶
type TaggedItem ¶
type UserClassification ¶
type UserClassification int
const ( NO_DECISION UserClassification = iota POSITIVE NEGATIVE )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.