Documentation
¶
Index ¶
- func Init() error
- type GormStore
- func (s *GormStore) Close() error
- func (s *GormStore) DeleteFeed(id string) error
- func (s *GormStore) DeleteFeedArticles(feedId string) error
- func (s *GormStore) DeleteFeedGroup(id string) error
- func (s *GormStore) FindDigestsWithSameArticleSet(digestId string) ([]models.Digest, error)
- func (s *GormStore) GetAllArticleAnalyses(articleId string) ([]models.ArticleAnalysis, error)
- func (s *GormStore) GetArticle(id string) (models.Article, error)
- func (s *GormStore) GetArticleAnalysesBatch(articleIds []string) (map[string]*models.ArticleAnalysis, error)
- func (s *GormStore) GetArticleAnalysis(articleId string) (*models.ArticleAnalysis, error)
- func (s *GormStore) GetArticleCounts(filter models.ArticleFilter) (models.ArticleCounts, error)
- func (s *GormStore) GetArticlesBatch(ids []string) ([]models.Article, error)
- func (s *GormStore) GetCategories() ([]models.Category, error)
- func (s *GormStore) GetDigest(id string) (models.Digest, error)
- func (s *GormStore) GetDigestAnalyses(digestId string) ([]models.DigestAnalysis, error)
- func (s *GormStore) GetDigestArticles(digestId string) ([]models.Article, error)
- func (s *GormStore) GetDigestProviderResult(id string) (models.DigestProviderResult, error)
- func (s *GormStore) GetDigestProviderResults(digestId string) ([]models.DigestProviderResult, error)
- func (s *GormStore) GetFeed(id string) (models.Feed, error)
- func (s *GormStore) GetFeedGroup(id string) (models.FeedGroup, error)
- func (s *GormStore) GetOrCreateCategory(name string) (*models.Category, error)
- func (s *GormStore) ListArticles(filter models.ArticleFilter) ([]models.Article, error)
- func (s *GormStore) ListDigests(limit int, full bool) ([]models.Digest, error)
- func (s *GormStore) ListFeedGroups() ([]models.FeedGroup, error)
- func (s *GormStore) ListFeeds() ([]models.Feed, error)
- func (s *GormStore) MarkFeedArticlesAsRead(feedId string) error
- func (s *GormStore) SaveArticleAnalysis(analysis *models.ArticleAnalysis) error
- func (s *GormStore) SaveCategory(category models.Category) error
- func (s *GormStore) StoreArticle(article models.Article) error
- func (s *GormStore) StoreDigest(digest models.Digest) error
- func (s *GormStore) StoreDigestAnalysesBatch(entries []models.DigestAnalysis) error
- func (s *GormStore) StoreDigestAnalysis(entry models.DigestAnalysis) error
- func (s *GormStore) StoreDigestArticle(digestId string, articleId string) error
- func (s *GormStore) StoreDigestArticlesBatch(digestId string, articleIds []string) error
- func (s *GormStore) StoreDigestProviderResult(result models.DigestProviderResult) error
- func (s *GormStore) StoreFeed(feed models.Feed) error
- func (s *GormStore) StoreFeedGroup(group models.FeedGroup) error
- func (s *GormStore) UpdateArticle(id string, update models.ArticleUpdate) error
- func (s *GormStore) UpdateFeedLastFetch(id string, lastFetch time.Time) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GormStore ¶
type GormStore struct {
// contains filtered or unexported fields
}
GormStore implements the Store interface using GORM
var (
Db *GormStore
)
func (*GormStore) Close ¶
Close closes the database connection by getting the underlying SQL DB instance
func (*GormStore) DeleteFeed ¶
func (*GormStore) DeleteFeedArticles ¶
func (*GormStore) DeleteFeedGroup ¶
DeleteFeedGroup deletes a feed group
func (*GormStore) FindDigestsWithSameArticleSet ¶
FindDigestsWithSameArticleSet returns all digests (including digestId itself) whose digest_articles set is exactly equal to digestId's set, ordered by created_at DESC. ProviderResults are populated so callers can label each sibling by its provider/model.
func (*GormStore) GetAllArticleAnalyses ¶
func (s *GormStore) GetAllArticleAnalyses(articleId string) ([]models.ArticleAnalysis, error)
func (*GormStore) GetArticleAnalysesBatch ¶
func (s *GormStore) GetArticleAnalysesBatch(articleIds []string) (map[string]*models.ArticleAnalysis, error)
GetArticleAnalysesBatch returns the most recent analysis for each of the given article IDs.
func (*GormStore) GetArticleAnalysis ¶
func (s *GormStore) GetArticleAnalysis(articleId string) (*models.ArticleAnalysis, error)
func (*GormStore) GetArticleCounts ¶
func (s *GormStore) GetArticleCounts(filter models.ArticleFilter) (models.ArticleCounts, error)
func (*GormStore) GetArticlesBatch ¶
func (*GormStore) GetDigestAnalyses ¶
func (s *GormStore) GetDigestAnalyses(digestId string) ([]models.DigestAnalysis, error)
func (*GormStore) GetDigestArticles ¶
func (*GormStore) GetDigestProviderResult ¶
func (s *GormStore) GetDigestProviderResult(id string) (models.DigestProviderResult, error)
func (*GormStore) GetDigestProviderResults ¶
func (s *GormStore) GetDigestProviderResults(digestId string) ([]models.DigestProviderResult, error)
func (*GormStore) GetFeedGroup ¶
GetFeedGroup returns a feed group by Id
func (*GormStore) GetOrCreateCategory ¶
GetOrCreateCategory returns a category with the given name, creating it if it doesn't exist.
func (*GormStore) ListArticles ¶
func (*GormStore) ListDigests ¶
func (*GormStore) ListFeedGroups ¶
ListFeedGroups returns all feed groups
func (*GormStore) MarkFeedArticlesAsRead ¶
func (*GormStore) SaveArticleAnalysis ¶
func (s *GormStore) SaveArticleAnalysis(analysis *models.ArticleAnalysis) error
func (*GormStore) StoreDigestAnalysesBatch ¶
func (s *GormStore) StoreDigestAnalysesBatch(entries []models.DigestAnalysis) error
func (*GormStore) StoreDigestAnalysis ¶
func (s *GormStore) StoreDigestAnalysis(entry models.DigestAnalysis) error
func (*GormStore) StoreDigestArticle ¶
func (*GormStore) StoreDigestArticlesBatch ¶
StoreDigestArticlesBatch associates a batch of articles with a digest in a single operation.
func (*GormStore) StoreDigestProviderResult ¶
func (s *GormStore) StoreDigestProviderResult(result models.DigestProviderResult) error
func (*GormStore) StoreFeedGroup ¶
StoreFeedGroup stores a feed group
func (*GormStore) UpdateArticle ¶
func (s *GormStore) UpdateArticle(id string, update models.ArticleUpdate) error
type Store ¶
type Store interface {
Close() error
StoreFeed(feed models.Feed) error
GetFeed(id string) (models.Feed, error)
ListFeeds() ([]models.Feed, error)
UpdateFeedLastFetch(id string, lastFetch time.Time) error
DeleteFeed(id string) error // Method for deleting a feed
StoreArticle(article models.Article) error
GetArticle(id string) (models.Article, error)
GetArticlesBatch(ids []string) ([]models.Article, error)
ListArticles(filter models.ArticleFilter) ([]models.Article, error)
GetArticleCounts(filter models.ArticleFilter) (models.ArticleCounts, error)
UpdateArticle(id string, update models.ArticleUpdate) error
MarkFeedArticlesAsRead(feedId string) error
DeleteFeedArticles(feedId string) error
StoreDigest(digest models.Digest) error
GetDigest(id string) (models.Digest, error)
ListDigests(limit int, full bool) ([]models.Digest, error)
StoreDigestArticle(digestId string, articleId string) error
StoreDigestArticlesBatch(digestId string, articleIds []string) error
GetDigestArticles(digestId string) ([]models.Article, error)
FindDigestsWithSameArticleSet(digestId string) ([]models.Digest, error)
StoreDigestProviderResult(result models.DigestProviderResult) error
GetDigestProviderResults(digestId string) ([]models.DigestProviderResult, error)
GetDigestProviderResult(id string) (models.DigestProviderResult, error)
StoreDigestAnalysis(entry models.DigestAnalysis) error
StoreDigestAnalysesBatch(entries []models.DigestAnalysis) error
GetDigestAnalyses(digestId string) ([]models.DigestAnalysis, error)
GetCategories() ([]models.Category, error)
SaveCategory(category models.Category) error
GetOrCreateCategory(name string) (*models.Category, error)
SaveArticleAnalysis(analysis *models.ArticleAnalysis) error
GetArticleAnalysis(articleId string) (*models.ArticleAnalysis, error)
GetArticleAnalysesBatch(articleIds []string) (map[string]*models.ArticleAnalysis, error)
GetAllArticleAnalyses(articleId string) ([]models.ArticleAnalysis, error)
ListFeedGroups() ([]models.FeedGroup, error)
GetFeedGroup(id string) (models.FeedGroup, error)
StoreFeedGroup(group models.FeedGroup) error
DeleteFeedGroup(id string) error
}