Documentation ¶
Overview ¶
Package repo provides routines to operate on Syndications SQL repo using models defined in the models package to map data in said repo.
Index ¶
- func AutoMigrateTables(db *gorm.DB)
- type Categories
- func (c Categories) AddFeed(userID, feedID, ctgID string) error
- func (c Categories) CategoryWithID(userID, id string) (ctg models.Category, found bool)
- func (c Categories) CategoryWithName(userID, name string) (ctg models.Category, found bool)
- func (c Categories) Create(userID string, ctg *models.Category)
- func (c Categories) Delete(userID, id string) error
- func (c Categories) Feeds(userID string, page models.Page) (feeds []models.Feed, next string)
- func (c Categories) List(userID string, page models.Page) (categories []models.Category, next string)
- func (c Categories) Mark(userID, ctgID string, marker models.Marker) error
- func (c Categories) Stats(userID, ctgID string) (models.Stats, error)
- func (c Categories) Uncategorized(userID string, page models.Page) (feeds []models.Feed, next string)
- func (c Categories) Update(userID string, ctg *models.Category) error
- type Entries
- func (e Entries) Create(userID string, entry *models.Entry)
- func (e Entries) DeleteOldEntries(userID string, timestamp time.Time)
- func (e Entries) EntryWithGUID(userID, guid string) (entry models.Entry, found bool)
- func (e Entries) EntryWithID(userID, id string) (entry models.Entry, found bool)
- func (e Entries) List(userID string, page models.Page) (entries []models.Entry, next string)
- func (e Entries) ListFromCategory(userID string, page models.Page) (entries []models.Entry, next string)
- func (e Entries) ListFromFeed(userID string, page models.Page) (entries []models.Entry, next string)
- func (e Entries) ListFromTags(userID string, tagIDs []string, page models.Page) (entries []models.Entry, next string)
- func (e Entries) Mark(userID, id string, marker models.Marker) error
- func (e Entries) MarkAll(userID string, marker models.Marker)
- func (e Entries) Stats(userID string) models.Stats
- func (e Entries) TagEntries(userID, tagID string, entryIDs []string) error
- type Feeds
- func (f Feeds) Create(userID string, feed *models.Feed)
- func (f Feeds) Delete(userID, id string) error
- func (f Feeds) FeedWithID(userID, id string) (feed models.Feed, found bool)
- func (f Feeds) List(userID string, page models.Page) (feeds []models.Feed, next string)
- func (f Feeds) Mark(userID, id string, marker models.Marker) error
- func (f Feeds) Stats(userID, id string) (models.Stats, error)
- func (f Feeds) Update(userID string, feed *models.Feed) error
- type Tags
- func (t Tags) Create(userID string, tag *models.Tag)
- func (t Tags) Delete(userID, id string) error
- func (t Tags) List(userID string, page models.Page) (tags []models.Tag, next string)
- func (t Tags) TagWithID(userID, id string) (tag models.Tag, found bool)
- func (t Tags) TagWithName(userID, name string) (tag models.Tag, found bool)
- func (t Tags) Update(userID string, tag *models.Tag) error
- type Users
- func (u Users) Create(user *models.User)
- func (u Users) Delete(id string) error
- func (u Users) List(page models.Page) (users []models.User, next string)
- func (u Users) Update(user *models.User) error
- func (u Users) UserWithID(id string) (user models.User, found bool)
- func (u Users) UserWithName(name string) (user models.User, found bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoMigrateTables ¶
Types ¶
type Categories ¶
type Categories struct {
// contains filtered or unexported fields
}
func NewCategories ¶
func NewCategories(db *gorm.DB) Categories
func (Categories) AddFeed ¶
func (c Categories) AddFeed(userID, feedID, ctgID string) error
AddFeed associates a feed to a category with ctgID
func (Categories) CategoryWithID ¶
func (c Categories) CategoryWithID(userID, id string) (ctg models.Category, found bool)
CategoryWithID returns a category with ID owned by user
func (Categories) CategoryWithName ¶
func (c Categories) CategoryWithName(userID, name string) (ctg models.Category, found bool)
CategoryWithName returns a Category that has a matching name and belongs to the given user
func (Categories) Create ¶
func (c Categories) Create(userID string, ctg *models.Category)
Create a new Category owned by user
func (Categories) Delete ¶
func (c Categories) Delete(userID, id string) error
Delete a category with id owned by user
func (Categories) List ¶
func (c Categories) List(userID string, page models.Page) (categories []models.Category, next string)
List all Categories owned by user
func (Categories) Mark ¶
func (c Categories) Mark(userID, ctgID string, marker models.Marker) error
Mark applies marker to a category with id and owned by user
func (Categories) Stats ¶
func (c Categories) Stats(userID, ctgID string) (models.Stats, error)
Stats returns all Stats for a Category with the given id and that is owned by user
func (Categories) Uncategorized ¶
func (c Categories) Uncategorized(userID string, page models.Page) (feeds []models.Feed, next string)
Uncategorized returns all Feeds that belong to a category with categoryID
type Entries ¶
type Entries struct {
// contains filtered or unexported fields
}
func NewEntries ¶
func (Entries) DeleteOldEntries ¶
DeleteOldEntries deletes entries older than a timestamp
func (Entries) EntryWithGUID ¶
EntryWithGUID returns an Entry with GUID and owned by user
func (Entries) EntryWithID ¶
EntryWithID returns an Entry with id owned by user
func (Entries) ListFromCategory ¶
func (e Entries) ListFromCategory(userID string, page models.Page) (entries []models.Entry, next string)
ListFromCategory all Entries that are associated to a Category
func (Entries) ListFromFeed ¶
func (e Entries) ListFromFeed(userID string, page models.Page) (entries []models.Entry, next string)
ListFromFeed returns all Entries associated to a feed
func (Entries) ListFromTags ¶
func (e Entries) ListFromTags(userID string, tagIDs []string, page models.Page) (entries []models.Entry, next string)
ListFromTags returns all Entries that are related to a list of tags
type Feeds ¶
type Feeds struct {
// contains filtered or unexported fields
}
func (Feeds) FeedWithID ¶
FeedWithID returns a Feed with id and owned by user
type Tags ¶
type Tags struct {
// contains filtered or unexported fields
}
func (Tags) TagWithName ¶
TagWithName returns a Tag that has a matching name and belongs to the given user