storage

package
v1.0.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

func (*CertificateCache) Get

func (c *CertificateCache) Get(ctx context.Context, key string) ([]byte, error)

Get returns a certificate data for the specified key. If there's no such key, Get returns ErrCacheMiss.

func (*CertificateCache) Put

func (c *CertificateCache) Put(ctx context.Context, key string, data []byte) error

Put stores the data in the cache under the specified key.

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) Entries

func (e *EntryPaginationBuilder) Entries() (*model.Entry, *model.Entry, error)

Entries returns previous and next entries.

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.

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) AfterDate

func (e *EntryQueryBuilder) AfterDate(date time.Time) *EntryQueryBuilder

AfterDate adds a condition > published_at

func (*EntryQueryBuilder) AfterEntryID

func (e *EntryQueryBuilder) AfterEntryID(entryID int64) *EntryQueryBuilder

AfterEntryID adds a condition > entryID.

func (*EntryQueryBuilder) BeforeDate

func (e *EntryQueryBuilder) BeforeDate(date time.Time) *EntryQueryBuilder

BeforeDate adds a condition < published_at

func (*EntryQueryBuilder) BeforeEntryID

func (e *EntryQueryBuilder) BeforeEntryID(entryID int64) *EntryQueryBuilder

BeforeEntryID adds a condition < entryID.

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) 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 NewStorage

func NewStorage(db *sql.DB) *Storage

NewStorage returns a new Storage.

func (*Storage) APIKeyExists

func (s *Storage) APIKeyExists(userID int64, description string) bool

APIKeyExists checks if an API Key with the same description exists.

func (*Storage) APIKeys

func (s *Storage) APIKeys(userID int64) (model.APIKeys, error)

APIKeys returns all API Keys that belongs to the given user.

func (*Storage) AnotherCategoryExists

func (s *Storage) AnotherCategoryExists(userID, categoryID int64, title string) bool

AnotherCategoryExists checks if another category exists with the same title.

func (*Storage) AnotherFeedURLExists

func (s *Storage) AnotherFeedURLExists(userID, feedID int64, feedURL string) bool

AnotherFeedURLExists checks if the user a duplicated feed.

func (*Storage) AnotherUserExists

func (s *Storage) AnotherUserExists(userID int64, username string) bool

AnotherUserExists checks if another user exists with the given username.

func (*Storage) AnotherUserWithFieldExists

func (s *Storage) AnotherUserWithFieldExists(userID int64, field, value string) bool

AnotherUserWithFieldExists returns true if a user has the value set for the given field.

func (*Storage) AppSession

func (s *Storage) AppSession(id string) (*model.Session, error)

AppSession returns the given session.

func (*Storage) ArchiveEntries

func (s *Storage) ArchiveEntries(status string, days, limit int) (int64, error)

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) Category

func (s *Storage) Category(userID, categoryID int64) (*model.Category, error)

Category returns a category from the database.

func (*Storage) CategoryByTitle

func (s *Storage) CategoryByTitle(userID int64, title string) (*model.Category, error)

CategoryByTitle finds a category by the title.

func (*Storage) CategoryIDExists

func (s *Storage) CategoryIDExists(userID, categoryID int64) bool

CategoryIDExists checks if the given category exists into the database.

func (*Storage) CategoryTitleExists

func (s *Storage) CategoryTitleExists(userID int64, title string) bool

CategoryTitleExists checks if the given category exists into the database.

func (*Storage) CheckPassword

func (s *Storage) CheckPassword(username, password string) error

CheckPassword validate the hashed password.

func (*Storage) CleanOldSessions

func (s *Storage) CleanOldSessions(days int) int64

CleanOldSessions removes sessions older than specified days.

func (*Storage) CleanOldUserSessions

func (s *Storage) CleanOldUserSessions(days int) int64

CleanOldUserSessions removes user sessions older than specified days.

func (*Storage) CountAllEntries

func (s *Storage) CountAllEntries() map[string]int64

CountAllEntries returns the number of entries for each status in the database.

func (*Storage) CountAllFeeds

func (s *Storage) CountAllFeeds() map[string]int64

CountAllFeeds returns the number of feeds in the database.

func (*Storage) CountAllFeedsWithErrors

func (s *Storage) CountAllFeedsWithErrors() int

CountAllFeedsWithErrors returns the number of feeds with parsing errors.

func (*Storage) CountFeeds

func (s *Storage) CountFeeds(userID int64) int

CountFeeds returns the number of feeds that belongs to the given user.

func (*Storage) CountUnreadEntries

func (s *Storage) CountUnreadEntries(userID int64) int

CountUnreadEntries returns the number of unread entries.

func (*Storage) CountUserFeedsWithErrors

func (s *Storage) CountUserFeedsWithErrors(userID int64) int

CountUserFeedsWithErrors returns the number of feeds with parsing errors that belong to the given user.

func (*Storage) CountUsers

func (s *Storage) CountUsers() int

CountUsers returns the total number of users.

func (*Storage) CreateAPIKey

func (s *Storage) CreateAPIKey(apiKey *model.APIKey) error

CreateAPIKey inserts a new API key.

func (*Storage) CreateAppSession

func (s *Storage) CreateAppSession() (*model.Session, error)

CreateAppSession creates a new application session.

func (*Storage) CreateAppSessionWithUserPrefs

func (s *Storage) CreateAppSessionWithUserPrefs(userID int64) (*model.Session, error)

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

func (s *Storage) CreateFeed(feed *model.Feed) error

CreateFeed creates a new feed.

func (*Storage) CreateFeedIcon

func (s *Storage) CreateFeedIcon(feedID int64, icon *model.Icon) error

CreateFeedIcon creates an icon and associate the icon to the given feed.

func (*Storage) CreateIcon

func (s *Storage) CreateIcon(icon *model.Icon) error

CreateIcon creates a new icon.

func (*Storage) CreateUser

func (s *Storage) CreateUser(userCreationRequest *model.UserCreationRequest) (*model.User, error)

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) DBStats

func (s *Storage) DBStats() sql.DBStats

DBStats returns database statistics.

func (*Storage) DatabaseVersion

func (s *Storage) DatabaseVersion() string

DatabaseVersion returns the version of the database which is in use.

func (*Storage) EntryShareCode

func (s *Storage) EntryShareCode(userID int64, entryID int64) (shareCode string, err error)

EntryShareCode returns the share code of the provided entry. It generates a new one if not already defined.

func (*Storage) EntryURLExists

func (s *Storage) EntryURLExists(feedID int64, entryURL string) bool

EntryURLExists returns true if an entry with this URL already exists.

func (*Storage) FeedByID

func (s *Storage) FeedByID(userID, feedID int64) (*model.Feed, error)

FeedByID returns a feed by the ID.

func (*Storage) FeedExists

func (s *Storage) FeedExists(userID, feedID int64) bool

FeedExists checks if the given feed exists.

func (*Storage) FeedURLExists

func (s *Storage) FeedURLExists(userID int64, feedURL string) bool

FeedURLExists checks if feed URL already exists.

func (*Storage) Feeds

func (s *Storage) Feeds(userID int64) (model.Feeds, error)

Feeds returns all feeds that belongs to the given user.

func (*Storage) FeedsByCategoryWithCounters

func (s *Storage) FeedsByCategoryWithCounters(userID, categoryID int64) (model.Feeds, error)

FeedsByCategoryWithCounters returns all feeds of the given user/category with counters of read and unread entries.

func (*Storage) FeedsWithCounters

func (s *Storage) FeedsWithCounters(userID int64) (model.Feeds, error)

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

func (s *Storage) FirstCategory(userID int64) (*model.Category, error)

FirstCategory returns the first category for the given user.

func (*Storage) FlushAllSessions

func (s *Storage) FlushAllSessions() (err error)

FlushAllSessions removes all sessions from the database.

func (*Storage) FlushHistory

func (s *Storage) FlushHistory(userID int64) error

FlushHistory set all entries with the status "read" to "removed".

func (*Storage) GetEnclosure

func (s *Storage) GetEnclosure(enclosureID int64) (*model.Enclosure, error)

func (*Storage) GetEnclosures

func (s *Storage) GetEnclosures(entryID int64) (model.EnclosureList, error)

GetEnclosures returns all attachments for the given entry.

func (*Storage) GetReadTime

func (s *Storage) GetReadTime(entry *model.Entry, feed *model.Feed) int

GetReadTime fetches the read time of an entry based on its hash, and the feed id and user id from the feed. It's intended to be used on entries objects created by parsing a feed as they don't contain much information. The feed param helps to scope the search to a specific user and feed in order to avoid hash clashes.

func (*Storage) GoogleReaderUserCheckPassword

func (s *Storage) GoogleReaderUserCheckPassword(username, password string) error

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

func (s *Storage) HasDuplicateFeverUsername(userID int64, feverUsername string) bool

HasDuplicateFeverUsername checks if another user have the same Fever username.

func (*Storage) HasDuplicateGoogleReaderUsername

func (s *Storage) HasDuplicateGoogleReaderUsername(userID int64, googleReaderUsername string) bool

HasDuplicateGoogleReaderUsername checks if another user have the same Google Reader username.

func (*Storage) HasIcon

func (s *Storage) HasIcon(feedID int64) bool

HasIcon checks if the given feed has an icon.

func (*Storage) HasPassword

func (s *Storage) HasPassword(userID int64) (bool, error)

HasPassword returns true if the given user has a password defined.

func (*Storage) HasSaveEntry

func (s *Storage) HasSaveEntry(userID int64) (result bool)

HasSaveEntry returns true if the given user can save articles to third-parties.

func (*Storage) IconByFeedID

func (s *Storage) IconByFeedID(userID, feedID int64) (*model.Icon, error)

IconByFeedID returns a feed icon.

func (*Storage) IconByHash

func (s *Storage) IconByHash(icon *model.Icon) error

IconByHash returns an icon by the hash (checksum).

func (*Storage) IconByID

func (s *Storage) IconByID(iconID int64) (*model.Icon, error)

IconByID returns an icon by the ID.

func (*Storage) Icons

func (s *Storage) Icons(userID int64) (model.Icons, error)

Icons returns all icons that belongs to a user.

func (*Storage) Integration

func (s *Storage) Integration(userID int64) (*model.Integration, error)

Integration returns user integration settings.

func (*Storage) MarkAllAsRead

func (s *Storage) MarkAllAsRead(userID int64) error

MarkAllAsRead updates all user entries to the read status.

func (*Storage) MarkCategoryAsRead

func (s *Storage) MarkCategoryAsRead(userID, categoryID int64, before time.Time) error

MarkCategoryAsRead updates all category entries to the read status.

func (*Storage) MarkFeedAsRead

func (s *Storage) MarkFeedAsRead(userID, feedID int64, before time.Time) error

MarkFeedAsRead updates all feed entries to the read status.

func (*Storage) MarkGloballyVisibleFeedsAsRead

func (s *Storage) MarkGloballyVisibleFeedsAsRead(userID int64) error

MarkGloballyVisibleFeedsAsRead updates all user entries to the read status.

func (*Storage) NewBatch

func (s *Storage) NewBatch(batchSize int) (jobs model.JobList, err error)

NewBatch returns a series of jobs.

func (*Storage) NewCategoryBatch

func (s *Storage) NewCategoryBatch(userID int64, categoryID int64, batchSize int) (jobs model.JobList, err error)

NewCategoryBatch returns a series of jobs but only for a given category.

func (*Storage) NewEntryQueryBuilder

func (s *Storage) NewEntryQueryBuilder(userID int64) *EntryQueryBuilder

NewEntryQueryBuilder returns a new EntryQueryBuilder

func (*Storage) NewUserBatch

func (s *Storage) NewUserBatch(userID int64, batchSize int) (jobs model.JobList, err error)

NewUserBatch returns a series of jobs but only for a given user.

func (*Storage) Ping

func (s *Storage) Ping() error

Ping checks if the database connection works.

func (*Storage) RefreshFeedEntries

func (s *Storage) RefreshFeedEntries(userID, feedID int64, entries model.Entries, updateExistingEntries bool) (err error)

RefreshFeedEntries updates feed entries while refreshing a feed.

func (*Storage) RemoveAPIKey

func (s *Storage) RemoveAPIKey(userID, keyID int64) error

RemoveAPIKey deletes an API Key.

func (*Storage) RemoveAndReplaceCategoriesByName

func (s *Storage) RemoveAndReplaceCategoriesByName(userid int64, titles []string) error

delete the given categories, replacing those categories with the user's first category on affected feeds

func (*Storage) RemoveCategory

func (s *Storage) RemoveCategory(userID, categoryID int64) error

RemoveCategory deletes a category.

func (*Storage) RemoveFeed

func (s *Storage) RemoveFeed(userID, feedID int64) error

RemoveFeed removes a feed and all entries. This operation can takes time if the feed has lot of entries.

func (*Storage) RemoveUser

func (s *Storage) RemoveUser(userID int64) error

RemoveUser deletes a user.

func (*Storage) RemoveUserAsync

func (s *Storage) RemoveUserAsync(userID int64)

RemoveUserAsync deletes user data without locking the database.

func (*Storage) RemoveUserSessionByID

func (s *Storage) RemoveUserSessionByID(userID, sessionID int64) error

RemoveUserSessionByID remove a session by using the ID.

func (*Storage) RemoveUserSessionByToken

func (s *Storage) RemoveUserSessionByToken(userID int64, token string) error

RemoveUserSessionByToken remove a session by using the token.

func (*Storage) ResetFeedErrors

func (s *Storage) ResetFeedErrors() error

ResetFeedErrors removes all feed errors.

func (*Storage) SetAPIKeyUsedTimestamp

func (s *Storage) SetAPIKeyUsedTimestamp(userID int64, token string) error

SetAPIKeyUsedTimestamp updates the last used date of an API Key.

func (*Storage) SetEntriesBookmarkedState

func (s *Storage) SetEntriesBookmarkedState(userID int64, entryIDs []int64, starred bool) error

SetEntriesBookmarked update the bookmarked state for the given list of entries.

func (*Storage) SetEntriesStatus

func (s *Storage) SetEntriesStatus(userID int64, entryIDs []int64, status string) error

SetEntriesStatus update the status of the given list of entries.

func (*Storage) SetEntriesStatusCount

func (s *Storage) SetEntriesStatusCount(userID int64, entryIDs []int64, status string) (int, error)

func (*Storage) SetLastLogin

func (s *Storage) SetLastLogin(userID int64) error

SetLastLogin updates the last login date of a user.

func (*Storage) Timezones

func (s *Storage) Timezones() (map[string]string, error)

Timezones returns all timezones supported by the database.

func (*Storage) ToggleBookmark

func (s *Storage) ToggleBookmark(userID int64, entryID int64) error

ToggleBookmark toggles entry bookmark value.

func (*Storage) UnshareEntry

func (s *Storage) UnshareEntry(userID int64, entryID int64) (err error)

UnshareEntry removes the share code for the given entry.

func (*Storage) UpdateAppSessionField

func (s *Storage) UpdateAppSessionField(sessionID, field string, value interface{}) error

UpdateAppSessionField updates only one session field.

func (*Storage) UpdateCategory

func (s *Storage) UpdateCategory(category *model.Category) error

UpdateCategory updates an existing category.

func (*Storage) UpdateEnclosure

func (s *Storage) UpdateEnclosure(enclosure *model.Enclosure) error

func (*Storage) UpdateEntryContent

func (s *Storage) UpdateEntryContent(entry *model.Entry) error

UpdateEntryContent updates entry content.

func (*Storage) UpdateFeed

func (s *Storage) UpdateFeed(feed *model.Feed) (err error)

UpdateFeed updates an existing feed.

func (*Storage) UpdateFeedError

func (s *Storage) UpdateFeedError(feed *model.Feed) (err error)

UpdateFeedError updates feed errors.

func (*Storage) UpdateIntegration

func (s *Storage) UpdateIntegration(integration *model.Integration) error

UpdateIntegration saves user integration settings.

func (*Storage) UpdateUser

func (s *Storage) UpdateUser(user *model.User) error

UpdateUser updates a user.

func (*Storage) UserByAPIKey

func (s *Storage) UserByAPIKey(token string) (*model.User, error)

UserByAPIKey returns a User from an API Key.

func (*Storage) UserByFeverToken

func (s *Storage) UserByFeverToken(token string) (*model.User, error)

UserByFeverToken returns a user by using the Fever API token.

func (*Storage) UserByField

func (s *Storage) UserByField(field, value string) (*model.User, error)

UserByField finds a user by a field value.

func (*Storage) UserByID

func (s *Storage) UserByID(userID int64) (*model.User, error)

UserByID finds a user by the ID.

func (*Storage) UserByUsername

func (s *Storage) UserByUsername(username string) (*model.User, error)

UserByUsername finds a user by the username.

func (*Storage) UserExists

func (s *Storage) UserExists(username string) bool

UserExists checks if a user exists by using the given username.

func (*Storage) UserLanguage

func (s *Storage) UserLanguage(userID int64) (language string)

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) Users

func (s *Storage) Users() (model.Users, error)

Users returns all users.

func (*Storage) WeeklyFeedEntryCount

func (s *Storage) WeeklyFeedEntryCount(userID, feedID int64) (int, error)

WeeklyFeedEntryCount returns the weekly entry count for a feed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL