Documentation ¶
Index ¶
- type BatchBuilder
- func (b *BatchBuilder) FetchJobs() (jobs model.JobList, err error)
- func (b *BatchBuilder) WithBatchSize(batchSize int) *BatchBuilder
- func (b *BatchBuilder) WithCategoryID(categoryID int64) *BatchBuilder
- func (b *BatchBuilder) WithErrorLimit(limit int) *BatchBuilder
- func (b *BatchBuilder) WithNextCheckExpired() *BatchBuilder
- func (b *BatchBuilder) WithUserID(userID int64) *BatchBuilder
- func (b *BatchBuilder) WithoutDisabledFeeds() *BatchBuilder
- type CertificateCache
- type EntryPaginationBuilder
- func (e *EntryPaginationBuilder) Entries() (*model.Entry, *model.Entry, error)
- func (e *EntryPaginationBuilder) WithCategoryID(categoryID int64)
- func (e *EntryPaginationBuilder) WithFeedID(feedID int64)
- func (e *EntryPaginationBuilder) WithGloballyVisible()
- func (e *EntryPaginationBuilder) WithSearchQuery(query string)
- func (e *EntryPaginationBuilder) WithStarred()
- func (e *EntryPaginationBuilder) WithStatus(status string)
- func (e *EntryPaginationBuilder) WithTags(tags []string)
- type EntryQueryBuilder
- func (e *EntryQueryBuilder) AfterChangedDate(date time.Time) *EntryQueryBuilder
- func (e *EntryQueryBuilder) AfterEntryID(entryID int64) *EntryQueryBuilder
- func (e *EntryQueryBuilder) AfterPublishedDate(date time.Time) *EntryQueryBuilder
- func (e *EntryQueryBuilder) BeforeChangedDate(date time.Time) *EntryQueryBuilder
- func (e *EntryQueryBuilder) BeforeEntryID(entryID int64) *EntryQueryBuilder
- func (e *EntryQueryBuilder) BeforePublishedDate(date time.Time) *EntryQueryBuilder
- func (e *EntryQueryBuilder) CountEntries() (count int, err error)
- func (e *EntryQueryBuilder) GetEntries() (model.Entries, error)
- func (e *EntryQueryBuilder) GetEntry() (*model.Entry, error)
- func (e *EntryQueryBuilder) GetEntryIDs() ([]int64, error)
- func (e *EntryQueryBuilder) WithCategoryID(categoryID int64) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithEnclosures() *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithEntryID(entryID int64) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithEntryIDs(entryIDs []int64) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithFeedID(feedID int64) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithGloballyVisible() *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithLimit(limit int) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithOffset(offset int) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithSearchQuery(query string) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithShareCode(shareCode string) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithShareCodeNotEmpty() *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithSorting(column, direction string) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithStarred(starred bool) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithStatus(status string) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithStatuses(statuses []string) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithTags(tags []string) *EntryQueryBuilder
- func (e *EntryQueryBuilder) WithoutStatus(status string) *EntryQueryBuilder
- type FeedQueryBuilder
- func (f *FeedQueryBuilder) GetFeed() (*model.Feed, error)
- func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error)
- func (f *FeedQueryBuilder) WithCategoryID(categoryID int64) *FeedQueryBuilder
- func (f *FeedQueryBuilder) WithCounters() *FeedQueryBuilder
- func (f *FeedQueryBuilder) WithFeedID(feedID int64) *FeedQueryBuilder
- func (f *FeedQueryBuilder) WithLimit(limit int) *FeedQueryBuilder
- func (f *FeedQueryBuilder) WithOffset(offset int) *FeedQueryBuilder
- func (f *FeedQueryBuilder) WithSorting(column, direction string) *FeedQueryBuilder
- type Storage
- func (s *Storage) APIKeyExists(userID int64, description string) bool
- func (s *Storage) APIKeys(userID int64) (model.APIKeys, error)
- func (s *Storage) AddWebAuthnCredential(userID int64, handle []byte, credential *webauthn.Credential) error
- func (s *Storage) AnotherCategoryExists(userID, categoryID int64, title string) bool
- func (s *Storage) AnotherFeedURLExists(userID, feedID int64, feedURL string) bool
- func (s *Storage) AnotherUserExists(userID int64, username string) bool
- func (s *Storage) AnotherUserWithFieldExists(userID int64, field, value string) bool
- func (s *Storage) AppSession(id string) (*model.Session, error)
- func (s *Storage) ArchiveEntries(status string, days, limit int) (int64, error)
- func (s *Storage) Categories(userID int64) (model.Categories, error)
- func (s *Storage) CategoriesWithFeedCount(userID int64) (model.Categories, error)
- func (s *Storage) Category(userID, categoryID int64) (*model.Category, error)
- func (s *Storage) CategoryByTitle(userID int64, title string) (*model.Category, error)
- func (s *Storage) CategoryIDExists(userID, categoryID int64) bool
- func (s *Storage) CategoryTitleExists(userID int64, title string) bool
- func (s *Storage) CheckPassword(username, password string) error
- func (s *Storage) CleanOldSessions(days int) int64
- func (s *Storage) CleanOldUserSessions(days int) int64
- func (s *Storage) CountAllEntries() map[string]int64
- func (s *Storage) CountAllFeeds() map[string]int64
- func (s *Storage) CountAllFeedsWithErrors() int
- func (s *Storage) CountUnreadEntries(userID int64) int
- func (s *Storage) CountUserFeedsWithErrors(userID int64) int
- func (s *Storage) CountUsers() int
- func (s *Storage) CountWebAuthnCredentialsByUserID(userID int64) int
- func (s *Storage) CreateAPIKey(apiKey *model.APIKey) error
- func (s *Storage) CreateAppSession() (*model.Session, error)
- func (s *Storage) CreateAppSessionWithUserPrefs(userID int64) (*model.Session, error)
- func (s *Storage) CreateCategory(userID int64, request *model.CategoryRequest) (*model.Category, error)
- func (s *Storage) CreateFeed(feed *model.Feed) error
- func (s *Storage) CreateFeedIcon(feedID int64, icon *model.Icon) error
- func (s *Storage) CreateIcon(icon *model.Icon) error
- func (s *Storage) CreateUser(userCreationRequest *model.UserCreationRequest) (*model.User, error)
- func (s *Storage) CreateUserSessionFromUsername(username, userAgent, ip string) (sessionID string, userID int64, err error)
- func (s *Storage) DBStats() sql.DBStats
- func (s *Storage) DatabaseVersion() string
- func (s *Storage) DeleteAllWebAuthnCredentialsByUserID(userID int64) error
- func (s *Storage) DeleteCredentialByHandle(userID int64, handle []byte) error
- func (s *Storage) EntryShareCode(userID int64, entryID int64) (shareCode string, err error)
- func (s *Storage) FeedByID(userID, feedID int64) (*model.Feed, error)
- func (s *Storage) FeedExists(userID, feedID int64) bool
- func (s *Storage) FeedURLExists(userID int64, feedURL string) bool
- func (s *Storage) Feeds(userID int64) (model.Feeds, error)
- func (s *Storage) FeedsByCategoryWithCounters(userID, categoryID int64) (model.Feeds, error)
- func (s *Storage) FeedsWithCounters(userID int64) (model.Feeds, error)
- func (s *Storage) FetchCounters(userID int64) (model.FeedCounters, error)
- func (s *Storage) FirstCategory(userID int64) (*model.Category, error)
- func (s *Storage) FlushAllSessions() (err error)
- func (s *Storage) FlushHistory(userID int64) error
- func (s *Storage) GetEnclosure(enclosureID int64) (*model.Enclosure, error)
- func (s *Storage) GetEnclosures(entryID int64) (model.EnclosureList, error)
- func (s *Storage) GetReadTime(feedID int64, entryHash string) int
- func (s *Storage) GoogleReaderUserCheckPassword(username, password string) error
- func (s *Storage) GoogleReaderUserGetIntegration(username string) (*model.Integration, error)
- func (s *Storage) HasDuplicateFeverUsername(userID int64, feverUsername string) bool
- func (s *Storage) HasDuplicateGoogleReaderUsername(userID int64, googleReaderUsername string) bool
- func (s *Storage) HasIcon(feedID int64) bool
- func (s *Storage) HasPassword(userID int64) (bool, error)
- func (s *Storage) HasSaveEntry(userID int64) (result bool)
- func (s *Storage) IconByFeedID(userID, feedID int64) (*model.Icon, error)
- func (s *Storage) IconByHash(icon *model.Icon) error
- func (s *Storage) IconByID(iconID int64) (*model.Icon, error)
- func (s *Storage) Icons(userID int64) (model.Icons, error)
- func (s *Storage) Integration(userID int64) (*model.Integration, error)
- func (s *Storage) IsNewEntry(feedID int64, entryHash string) bool
- func (s *Storage) MarkAllAsRead(userID int64) error
- func (s *Storage) MarkCategoryAsRead(userID, categoryID int64, before time.Time) error
- func (s *Storage) MarkFeedAsRead(userID, feedID int64, before time.Time) error
- func (s *Storage) MarkGloballyVisibleFeedsAsRead(userID int64) error
- func (s *Storage) NewBatchBuilder() *BatchBuilder
- func (s *Storage) NewEntryQueryBuilder(userID int64) *EntryQueryBuilder
- func (s *Storage) Ping() error
- func (s *Storage) RefreshFeedEntries(userID, feedID int64, entries model.Entries, updateExistingEntries bool) (newEntries model.Entries, err error)
- func (s *Storage) RemoveAPIKey(userID, keyID int64) error
- func (s *Storage) RemoveAndReplaceCategoriesByName(userid int64, titles []string) error
- func (s *Storage) RemoveCategory(userID, categoryID int64) error
- func (s *Storage) RemoveFeed(userID, feedID int64) error
- func (s *Storage) RemoveUser(userID int64) error
- func (s *Storage) RemoveUserAsync(userID int64)
- func (s *Storage) RemoveUserSessionByID(userID, sessionID int64) error
- func (s *Storage) RemoveUserSessionByToken(userID int64, token string) error
- func (s *Storage) ResetFeedErrors() error
- func (s *Storage) SetAPIKeyUsedTimestamp(userID int64, token string) error
- func (s *Storage) SetEntriesBookmarkedState(userID int64, entryIDs []int64, starred bool) error
- func (s *Storage) SetEntriesStatus(userID int64, entryIDs []int64, status string) error
- func (s *Storage) SetEntriesStatusCount(userID int64, entryIDs []int64, status string) (int, error)
- func (s *Storage) SetLastLogin(userID int64) error
- func (s *Storage) Timezones() (map[string]string, error)
- func (s *Storage) ToggleBookmark(userID int64, entryID int64) error
- func (s *Storage) UnshareEntry(userID int64, entryID int64) (err error)
- func (s *Storage) UpdateAppSessionField(sessionID, field string, value any) error
- func (s *Storage) UpdateAppSessionObjectField(sessionID, field string, value interface{}) error
- func (s *Storage) UpdateCategory(category *model.Category) error
- func (s *Storage) UpdateEnclosure(enclosure *model.Enclosure) error
- func (s *Storage) UpdateEntryTitleAndContent(entry *model.Entry) error
- func (s *Storage) UpdateFeed(feed *model.Feed) (err error)
- func (s *Storage) UpdateFeedError(feed *model.Feed) (err error)
- func (s *Storage) UpdateIntegration(integration *model.Integration) error
- func (s *Storage) UpdateUser(user *model.User) error
- func (s *Storage) UserByAPIKey(token string) (*model.User, error)
- func (s *Storage) UserByFeverToken(token string) (*model.User, error)
- func (s *Storage) UserByField(field, value string) (*model.User, error)
- func (s *Storage) UserByID(userID int64) (*model.User, error)
- func (s *Storage) UserByUsername(username string) (*model.User, error)
- func (s *Storage) UserExists(username string) bool
- func (s *Storage) UserLanguage(userID int64) (language string)
- func (s *Storage) UserSessionByToken(token string) (*model.UserSession, error)
- func (s *Storage) UserSessions(userID int64) (model.UserSessions, error)
- func (s *Storage) Users() (model.Users, error)
- func (s *Storage) WebAuthnCredentialByHandle(handle []byte) (int64, *model.WebAuthnCredential, error)
- func (s *Storage) WebAuthnCredentialsByUserID(userID int64) ([]model.WebAuthnCredential, error)
- func (s *Storage) WebAuthnSaveLogin(handle []byte) error
- func (s *Storage) WebAuthnUpdateName(handle []byte, name string) error
- func (s *Storage) WeeklyFeedEntryCount(userID, feedID int64) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchBuilder ¶ added in v2.0.51
type BatchBuilder struct {
// contains filtered or unexported fields
}
func (*BatchBuilder) FetchJobs ¶ added in v2.0.51
func (b *BatchBuilder) FetchJobs() (jobs model.JobList, err error)
func (*BatchBuilder) WithBatchSize ¶ added in v2.0.51
func (b *BatchBuilder) WithBatchSize(batchSize int) *BatchBuilder
func (*BatchBuilder) WithCategoryID ¶ added in v2.0.51
func (b *BatchBuilder) WithCategoryID(categoryID int64) *BatchBuilder
func (*BatchBuilder) WithErrorLimit ¶ added in v2.0.51
func (b *BatchBuilder) WithErrorLimit(limit int) *BatchBuilder
func (*BatchBuilder) WithNextCheckExpired ¶ added in v2.0.51
func (b *BatchBuilder) WithNextCheckExpired() *BatchBuilder
func (*BatchBuilder) WithUserID ¶ added in v2.0.51
func (b *BatchBuilder) WithUserID(userID int64) *BatchBuilder
func (*BatchBuilder) WithoutDisabledFeeds ¶ added in v2.0.51
func (b *BatchBuilder) WithoutDisabledFeeds() *BatchBuilder
type CertificateCache ¶
type CertificateCache struct {
// contains filtered or unexported fields
}
CertificateCache provides a SQL backend to the autocert cache.
func NewCertificateCache ¶
func NewCertificateCache(storage *Storage) *CertificateCache
NewCertificateCache creates an cache instance that can be used with autocert.Cache. It returns any errors that could happen while connecting to SQL.
func (*CertificateCache) Delete ¶
func (c *CertificateCache) Delete(ctx context.Context, key string) error
Delete removes a certificate data from the cache under the specified key. If there's no such key in the cache, Delete returns nil.
type EntryPaginationBuilder ¶
type EntryPaginationBuilder struct {
// contains filtered or unexported fields
}
EntryPaginationBuilder is a builder for entry prev/next queries.
func NewEntryPaginationBuilder ¶
func NewEntryPaginationBuilder(store *Storage, userID, entryID int64, order, direction string) *EntryPaginationBuilder
NewEntryPaginationBuilder returns a new EntryPaginationBuilder.
func (*EntryPaginationBuilder) WithCategoryID ¶
func (e *EntryPaginationBuilder) WithCategoryID(categoryID int64)
WithCategoryID adds category_id to the condition.
func (*EntryPaginationBuilder) WithFeedID ¶
func (e *EntryPaginationBuilder) WithFeedID(feedID int64)
WithFeedID adds feed_id to the condition.
func (*EntryPaginationBuilder) WithGloballyVisible ¶
func (e *EntryPaginationBuilder) WithGloballyVisible()
WithGloballyVisible adds global visibility to the condition.
func (*EntryPaginationBuilder) WithSearchQuery ¶
func (e *EntryPaginationBuilder) WithSearchQuery(query string)
WithSearchQuery adds full-text search query to the condition.
func (*EntryPaginationBuilder) WithStarred ¶
func (e *EntryPaginationBuilder) WithStarred()
WithStarred adds starred to the condition.
func (*EntryPaginationBuilder) WithStatus ¶
func (e *EntryPaginationBuilder) WithStatus(status string)
WithStatus adds status to the condition.
func (*EntryPaginationBuilder) WithTags ¶ added in v2.2.0
func (e *EntryPaginationBuilder) WithTags(tags []string)
type EntryQueryBuilder ¶
type EntryQueryBuilder struct {
// contains filtered or unexported fields
}
EntryQueryBuilder builds a SQL query to fetch entries.
func NewAnonymousQueryBuilder ¶
func NewAnonymousQueryBuilder(store *Storage) *EntryQueryBuilder
NewAnonymousQueryBuilder returns a new EntryQueryBuilder suitable for anonymous users.
func NewEntryQueryBuilder ¶
func NewEntryQueryBuilder(store *Storage, userID int64) *EntryQueryBuilder
NewEntryQueryBuilder returns a new EntryQueryBuilder.
func (*EntryQueryBuilder) AfterChangedDate ¶ added in v2.0.49
func (e *EntryQueryBuilder) AfterChangedDate(date time.Time) *EntryQueryBuilder
AfterChangedDate adds a condition > changed_at
func (*EntryQueryBuilder) AfterEntryID ¶
func (e *EntryQueryBuilder) AfterEntryID(entryID int64) *EntryQueryBuilder
AfterEntryID adds a condition > entryID.
func (*EntryQueryBuilder) AfterPublishedDate ¶ added in v2.0.49
func (e *EntryQueryBuilder) AfterPublishedDate(date time.Time) *EntryQueryBuilder
AfterPublishedDate adds a condition > published_at
func (*EntryQueryBuilder) BeforeChangedDate ¶ added in v2.0.49
func (e *EntryQueryBuilder) BeforeChangedDate(date time.Time) *EntryQueryBuilder
BeforeChangedDate adds a condition < changed_at
func (*EntryQueryBuilder) BeforeEntryID ¶
func (e *EntryQueryBuilder) BeforeEntryID(entryID int64) *EntryQueryBuilder
BeforeEntryID adds a condition < entryID.
func (*EntryQueryBuilder) BeforePublishedDate ¶ added in v2.0.49
func (e *EntryQueryBuilder) BeforePublishedDate(date time.Time) *EntryQueryBuilder
BeforePublishedDate adds a condition < published_at
func (*EntryQueryBuilder) CountEntries ¶
func (e *EntryQueryBuilder) CountEntries() (count int, err error)
CountEntries count the number of entries that match the condition.
func (*EntryQueryBuilder) GetEntries ¶
func (e *EntryQueryBuilder) GetEntries() (model.Entries, error)
GetEntries returns a list of entries that match the condition.
func (*EntryQueryBuilder) GetEntry ¶
func (e *EntryQueryBuilder) GetEntry() (*model.Entry, error)
GetEntry returns a single entry that match the condition.
func (*EntryQueryBuilder) GetEntryIDs ¶
func (e *EntryQueryBuilder) GetEntryIDs() ([]int64, error)
GetEntryIDs returns a list of entry IDs that match the condition.
func (*EntryQueryBuilder) WithCategoryID ¶
func (e *EntryQueryBuilder) WithCategoryID(categoryID int64) *EntryQueryBuilder
WithCategoryID filter by category ID.
func (*EntryQueryBuilder) WithEnclosures ¶ added in v2.0.49
func (e *EntryQueryBuilder) WithEnclosures() *EntryQueryBuilder
WithEnclosures fetches enclosures for each entry.
func (*EntryQueryBuilder) WithEntryID ¶
func (e *EntryQueryBuilder) WithEntryID(entryID int64) *EntryQueryBuilder
WithEntryID filter by entry ID.
func (*EntryQueryBuilder) WithEntryIDs ¶
func (e *EntryQueryBuilder) WithEntryIDs(entryIDs []int64) *EntryQueryBuilder
WithEntryIDs filter by entry IDs.
func (*EntryQueryBuilder) WithFeedID ¶
func (e *EntryQueryBuilder) WithFeedID(feedID int64) *EntryQueryBuilder
WithFeedID filter by feed ID.
func (*EntryQueryBuilder) WithGloballyVisible ¶
func (e *EntryQueryBuilder) WithGloballyVisible() *EntryQueryBuilder
func (*EntryQueryBuilder) WithLimit ¶
func (e *EntryQueryBuilder) WithLimit(limit int) *EntryQueryBuilder
WithLimit set the limit.
func (*EntryQueryBuilder) WithOffset ¶
func (e *EntryQueryBuilder) WithOffset(offset int) *EntryQueryBuilder
WithOffset set the offset.
func (*EntryQueryBuilder) WithSearchQuery ¶
func (e *EntryQueryBuilder) WithSearchQuery(query string) *EntryQueryBuilder
WithSearchQuery adds full-text search query to the condition.
func (*EntryQueryBuilder) WithShareCode ¶
func (e *EntryQueryBuilder) WithShareCode(shareCode string) *EntryQueryBuilder
WithShareCode set the entry share code.
func (*EntryQueryBuilder) WithShareCodeNotEmpty ¶
func (e *EntryQueryBuilder) WithShareCodeNotEmpty() *EntryQueryBuilder
WithShareCodeNotEmpty adds a filter for non-empty share code.
func (*EntryQueryBuilder) WithSorting ¶
func (e *EntryQueryBuilder) WithSorting(column, direction string) *EntryQueryBuilder
WithSorting add a sort expression.
func (*EntryQueryBuilder) WithStarred ¶
func (e *EntryQueryBuilder) WithStarred(starred bool) *EntryQueryBuilder
WithStarred adds starred filter.
func (*EntryQueryBuilder) WithStatus ¶
func (e *EntryQueryBuilder) WithStatus(status string) *EntryQueryBuilder
WithStatus filter by entry status.
func (*EntryQueryBuilder) WithStatuses ¶
func (e *EntryQueryBuilder) WithStatuses(statuses []string) *EntryQueryBuilder
WithStatuses filter by a list of entry statuses.
func (*EntryQueryBuilder) WithTags ¶
func (e *EntryQueryBuilder) WithTags(tags []string) *EntryQueryBuilder
WithTags filter by a list of entry tags.
func (*EntryQueryBuilder) WithoutStatus ¶
func (e *EntryQueryBuilder) WithoutStatus(status string) *EntryQueryBuilder
WithoutStatus set the entry status that should not be returned.
type FeedQueryBuilder ¶
type FeedQueryBuilder struct {
// contains filtered or unexported fields
}
FeedQueryBuilder builds a SQL query to fetch feeds.
func NewFeedQueryBuilder ¶
func NewFeedQueryBuilder(store *Storage, userID int64) *FeedQueryBuilder
NewFeedQueryBuilder returns a new FeedQueryBuilder.
func (*FeedQueryBuilder) GetFeed ¶
func (f *FeedQueryBuilder) GetFeed() (*model.Feed, error)
GetFeed returns a single feed that match the condition.
func (*FeedQueryBuilder) GetFeeds ¶
func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error)
GetFeeds returns a list of feeds that match the condition.
func (*FeedQueryBuilder) WithCategoryID ¶
func (f *FeedQueryBuilder) WithCategoryID(categoryID int64) *FeedQueryBuilder
WithCategoryID filter by category ID.
func (*FeedQueryBuilder) WithCounters ¶
func (f *FeedQueryBuilder) WithCounters() *FeedQueryBuilder
WithCounters let the builder return feeds with counters of statuses of entries.
func (*FeedQueryBuilder) WithFeedID ¶
func (f *FeedQueryBuilder) WithFeedID(feedID int64) *FeedQueryBuilder
WithFeedID filter by feed ID.
func (*FeedQueryBuilder) WithLimit ¶
func (f *FeedQueryBuilder) WithLimit(limit int) *FeedQueryBuilder
WithLimit set the limit.
func (*FeedQueryBuilder) WithOffset ¶
func (f *FeedQueryBuilder) WithOffset(offset int) *FeedQueryBuilder
WithOffset set the offset.
func (*FeedQueryBuilder) WithSorting ¶
func (f *FeedQueryBuilder) WithSorting(column, direction string) *FeedQueryBuilder
WithSorting add a sort expression.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage handles all operations related to the database.
func (*Storage) APIKeyExists ¶
APIKeyExists checks if an API Key with the same description exists.
func (*Storage) AddWebAuthnCredential ¶ added in v2.0.51
func (s *Storage) AddWebAuthnCredential(userID int64, handle []byte, credential *webauthn.Credential) error
handle storage of webauthn credentials
func (*Storage) AnotherCategoryExists ¶
AnotherCategoryExists checks if another category exists with the same title.
func (*Storage) AnotherFeedURLExists ¶
AnotherFeedURLExists checks if the user a duplicated feed.
func (*Storage) AnotherUserExists ¶
AnotherUserExists checks if another user exists with the given username.
func (*Storage) AnotherUserWithFieldExists ¶
AnotherUserWithFieldExists returns true if a user has the value set for the given field.
func (*Storage) AppSession ¶
AppSession returns the given session.
func (*Storage) ArchiveEntries ¶
ArchiveEntries changes the status of entries to "removed" after the given number of days.
func (*Storage) Categories ¶
func (s *Storage) Categories(userID int64) (model.Categories, error)
Categories returns all categories that belongs to the given user.
func (*Storage) CategoriesWithFeedCount ¶
func (s *Storage) CategoriesWithFeedCount(userID int64) (model.Categories, error)
CategoriesWithFeedCount returns all categories with the number of feeds.
func (*Storage) CategoryByTitle ¶
CategoryByTitle finds a category by the title.
func (*Storage) CategoryIDExists ¶
CategoryIDExists checks if the given category exists into the database.
func (*Storage) CategoryTitleExists ¶
CategoryTitleExists checks if the given category exists into the database.
func (*Storage) CheckPassword ¶
CheckPassword validate the hashed password.
func (*Storage) CleanOldSessions ¶
CleanOldSessions removes sessions older than specified days.
func (*Storage) CleanOldUserSessions ¶
CleanOldUserSessions removes user sessions older than specified days.
func (*Storage) CountAllEntries ¶
CountAllEntries returns the number of entries for each status in the database.
func (*Storage) CountAllFeeds ¶
CountAllFeeds returns the number of feeds in the database.
func (*Storage) CountAllFeedsWithErrors ¶
CountAllFeedsWithErrors returns the number of feeds with parsing errors.
func (*Storage) CountUnreadEntries ¶
CountUnreadEntries returns the number of unread entries.
func (*Storage) CountUserFeedsWithErrors ¶
CountUserFeedsWithErrors returns the number of feeds with parsing errors that belong to the given user.
func (*Storage) CountUsers ¶
CountUsers returns the total number of users.
func (*Storage) CountWebAuthnCredentialsByUserID ¶ added in v2.0.51
func (*Storage) CreateAPIKey ¶
CreateAPIKey inserts a new API key.
func (*Storage) CreateAppSession ¶
CreateAppSession creates a new application session.
func (*Storage) CreateAppSessionWithUserPrefs ¶
CreateAppSessionWithUserPrefs creates a new application session with the given user preferences.
func (*Storage) CreateCategory ¶
func (s *Storage) CreateCategory(userID int64, request *model.CategoryRequest) (*model.Category, error)
CreateCategory creates a new category.
func (*Storage) CreateFeed ¶
CreateFeed creates a new feed.
func (*Storage) CreateFeedIcon ¶
CreateFeedIcon creates an icon and associate the icon to the given feed.
func (*Storage) CreateIcon ¶
CreateIcon creates a new icon.
func (*Storage) CreateUser ¶
CreateUser creates a new user.
func (*Storage) CreateUserSessionFromUsername ¶
func (s *Storage) CreateUserSessionFromUsername(username, userAgent, ip string) (sessionID string, userID int64, err error)
CreateUserSessionFromUsername creates a new user session.
func (*Storage) DatabaseVersion ¶
DatabaseVersion returns the version of the database which is in use.
func (*Storage) DeleteAllWebAuthnCredentialsByUserID ¶ added in v2.0.51
func (*Storage) DeleteCredentialByHandle ¶ added in v2.0.51
func (*Storage) EntryShareCode ¶
EntryShareCode returns the share code of the provided entry. It generates a new one if not already defined.
func (*Storage) FeedExists ¶
FeedExists checks if the given feed exists.
func (*Storage) FeedURLExists ¶
FeedURLExists checks if feed URL already exists.
func (*Storage) FeedsByCategoryWithCounters ¶
FeedsByCategoryWithCounters returns all feeds of the given user/category with counters of read and unread entries.
func (*Storage) FeedsWithCounters ¶
FeedsWithCounters returns all feeds of the given user with counters of read and unread entries.
func (*Storage) FetchCounters ¶
func (s *Storage) FetchCounters(userID int64) (model.FeedCounters, error)
Return read and unread count.
func (*Storage) FirstCategory ¶
FirstCategory returns the first category for the given user.
func (*Storage) FlushAllSessions ¶
FlushAllSessions removes all sessions from the database.
func (*Storage) FlushHistory ¶
FlushHistory changes all entries with the status "read" to "removed".
func (*Storage) GetEnclosure ¶
func (*Storage) GetEnclosures ¶
func (s *Storage) GetEnclosures(entryID int64) (model.EnclosureList, error)
GetEnclosures returns all attachments for the given entry.
func (*Storage) GoogleReaderUserCheckPassword ¶
GoogleReaderUserCheckPassword validates the Google Reader hashed password.
func (*Storage) GoogleReaderUserGetIntegration ¶
func (s *Storage) GoogleReaderUserGetIntegration(username string) (*model.Integration, error)
GoogleReaderUserGetIntegration returns part of the Google Reader parts of the integration struct.
func (*Storage) HasDuplicateFeverUsername ¶
HasDuplicateFeverUsername checks if another user have the same Fever username.
func (*Storage) HasDuplicateGoogleReaderUsername ¶
HasDuplicateGoogleReaderUsername checks if another user have the same Google Reader username.
func (*Storage) HasPassword ¶
HasPassword returns true if the given user has a password defined.
func (*Storage) HasSaveEntry ¶
HasSaveEntry returns true if the given user can save articles to third-parties.
func (*Storage) IconByFeedID ¶
IconByFeedID returns a feed icon.
func (*Storage) IconByHash ¶
IconByHash returns an icon by the hash (checksum).
func (*Storage) Integration ¶
func (s *Storage) Integration(userID int64) (*model.Integration, error)
Integration returns user integration settings.
func (*Storage) IsNewEntry ¶ added in v2.2.0
func (*Storage) MarkAllAsRead ¶
MarkAllAsRead updates all user entries to the read status.
func (*Storage) MarkCategoryAsRead ¶
MarkCategoryAsRead updates all category entries to the read status.
func (*Storage) MarkFeedAsRead ¶
MarkFeedAsRead updates all feed entries to the read status.
func (*Storage) MarkGloballyVisibleFeedsAsRead ¶
MarkGloballyVisibleFeedsAsRead updates all user entries to the read status.
func (*Storage) NewBatchBuilder ¶ added in v2.0.51
func (s *Storage) NewBatchBuilder() *BatchBuilder
func (*Storage) NewEntryQueryBuilder ¶
func (s *Storage) NewEntryQueryBuilder(userID int64) *EntryQueryBuilder
NewEntryQueryBuilder returns a new EntryQueryBuilder
func (*Storage) RefreshFeedEntries ¶
func (s *Storage) RefreshFeedEntries(userID, feedID int64, entries model.Entries, updateExistingEntries bool) (newEntries model.Entries, err error)
RefreshFeedEntries updates feed entries while refreshing a feed.
func (*Storage) RemoveAPIKey ¶
RemoveAPIKey deletes an API Key.
func (*Storage) RemoveAndReplaceCategoriesByName ¶
delete the given categories, replacing those categories with the user's first category on affected feeds
func (*Storage) RemoveCategory ¶
RemoveCategory deletes a category.
func (*Storage) RemoveFeed ¶
RemoveFeed removes a feed and all entries. This operation can takes time if the feed has lot of entries.
func (*Storage) RemoveUser ¶
RemoveUser deletes a user.
func (*Storage) RemoveUserAsync ¶
RemoveUserAsync deletes user data without locking the database.
func (*Storage) RemoveUserSessionByID ¶
RemoveUserSessionByID remove a session by using the ID.
func (*Storage) RemoveUserSessionByToken ¶
RemoveUserSessionByToken remove a session by using the token.
func (*Storage) ResetFeedErrors ¶
ResetFeedErrors removes all feed errors.
func (*Storage) SetAPIKeyUsedTimestamp ¶
SetAPIKeyUsedTimestamp updates the last used date of an API Key.
func (*Storage) SetEntriesBookmarkedState ¶
SetEntriesBookmarked update the bookmarked state for the given list of entries.
func (*Storage) SetEntriesStatus ¶
SetEntriesStatus update the status of the given list of entries.
func (*Storage) SetEntriesStatusCount ¶
func (*Storage) SetLastLogin ¶
SetLastLogin updates the last login date of a user.
func (*Storage) ToggleBookmark ¶
ToggleBookmark toggles entry bookmark value.
func (*Storage) UnshareEntry ¶
UnshareEntry removes the share code for the given entry.
func (*Storage) UpdateAppSessionField ¶
UpdateAppSessionField updates only one session field.
func (*Storage) UpdateAppSessionObjectField ¶ added in v2.0.51
func (*Storage) UpdateCategory ¶
UpdateCategory updates an existing category.
func (*Storage) UpdateEnclosure ¶
func (*Storage) UpdateEntryTitleAndContent ¶ added in v2.0.49
UpdateEntryTitleAndContent updates entry title and content.
func (*Storage) UpdateFeed ¶
UpdateFeed updates an existing feed.
func (*Storage) UpdateFeedError ¶
UpdateFeedError updates feed errors.
func (*Storage) UpdateIntegration ¶
func (s *Storage) UpdateIntegration(integration *model.Integration) error
UpdateIntegration saves user integration settings.
func (*Storage) UpdateUser ¶
UpdateUser updates a user.
func (*Storage) UserByAPIKey ¶
UserByAPIKey returns a User from an API Key.
func (*Storage) UserByFeverToken ¶
UserByFeverToken returns a user by using the Fever API token.
func (*Storage) UserByField ¶
UserByField finds a user by a field value.
func (*Storage) UserByUsername ¶
UserByUsername finds a user by the username.
func (*Storage) UserExists ¶
UserExists checks if a user exists by using the given username.
func (*Storage) UserLanguage ¶
UserLanguage returns the language of the given user.
func (*Storage) UserSessionByToken ¶
func (s *Storage) UserSessionByToken(token string) (*model.UserSession, error)
UserSessionByToken finds a session by the token.
func (*Storage) UserSessions ¶
func (s *Storage) UserSessions(userID int64) (model.UserSessions, error)
UserSessions returns the list of sessions for the given user.
func (*Storage) WebAuthnCredentialByHandle ¶ added in v2.0.51
func (*Storage) WebAuthnCredentialsByUserID ¶ added in v2.0.51
func (s *Storage) WebAuthnCredentialsByUserID(userID int64) ([]model.WebAuthnCredential, error)