Documentation
¶
Overview ¶
Package storage handles data persistence using SQLite
Index ¶
- type DB
- func (db *DB) ClearFeedCache() error
- func (db *DB) Close() error
- func (db *DB) GetCacheTime() (*time.Time, error)
- func (db *DB) LoadFeedCache(url string) ([]byte, error)
- func (db *DB) LoadPostReadStatuses() (map[string]bool, error)
- func (db *DB) SaveFeedCache(url string, content []byte) error
- func (db *DB) SavePostReadStatus(uuid, feedURL string, read bool) error
- func (db *DB) SavePostReadStatuses(statuses []PostReadStatus) error
- func (db *DB) SetCacheTime() error
- type PostReadStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps the SQLite database connection
func NewDefault ¶
NewDefault creates a new database connection at the default XDG state location
func (*DB) ClearFeedCache ¶
ClearFeedCache removes all cached feed content
func (*DB) GetCacheTime ¶
GetCacheTime retrieves the last fetch time from the database
func (*DB) LoadFeedCache ¶
LoadFeedCache retrieves cached feed content from the database
func (*DB) LoadPostReadStatuses ¶
LoadPostReadStatuses returns a map of UUID to read status
func (*DB) SaveFeedCache ¶
SaveFeedCache stores the fetched feed content in the database
func (*DB) SavePostReadStatus ¶
SavePostReadStatus saves the read status for a single post
func (*DB) SavePostReadStatuses ¶
func (db *DB) SavePostReadStatuses(statuses []PostReadStatus) error
SavePostReadStatuses saves multiple read statuses in a single transaction
func (*DB) SetCacheTime ¶
SetCacheTime stores the current time as the last fetch time
type PostReadStatus ¶
PostReadStatus represents a post's read status in the database