Versions in this module Expand all Collapse all v1 v1.5.2 Aug 8, 2021 Changes in this version + type DB interface + CreateNewID func(table string) (int, error) + DeleteAccounts func(usernames ...string) error + DeleteBookmarks func(ids ...int) error + GetAccount func(username string) (model.Account, bool) + GetAccounts func(opts GetAccountsOptions) ([]model.Account, error) + GetBookmark func(id int, url string) (model.Bookmark, bool) + GetBookmarks func(opts GetBookmarksOptions) ([]model.Bookmark, error) + GetBookmarksCount func(opts GetBookmarksOptions) (int, error) + GetTags func() ([]model.Tag, error) + RenameTag func(id int, newName string) error + SaveAccount func(model.Account) error + SaveBookmarks func(bookmarks ...model.Bookmark) ([]model.Bookmark, error) + type GetAccountsOptions struct + Keyword string + Owner bool + type GetBookmarksOptions struct + ExcludedTags []string + IDs []int + Keyword string + Limit int + Offset int + OrderMethod OrderMethod + Tags []string + WithContent bool + type MySQLDatabase struct + func OpenMySQLDatabase(connString string) (mysqlDB *MySQLDatabase, err error) + func (db *MySQLDatabase) CreateNewID(table string) (int, error) + func (db *MySQLDatabase) DeleteAccounts(usernames ...string) (err error) + func (db *MySQLDatabase) DeleteBookmarks(ids ...int) (err error) + func (db *MySQLDatabase) GetAccount(username string) (model.Account, bool) + func (db *MySQLDatabase) GetAccounts(opts GetAccountsOptions) ([]model.Account, error) + func (db *MySQLDatabase) GetBookmark(id int, url string) (model.Bookmark, bool) + func (db *MySQLDatabase) GetBookmarks(opts GetBookmarksOptions) ([]model.Bookmark, error) + func (db *MySQLDatabase) GetBookmarksCount(opts GetBookmarksOptions) (int, error) + func (db *MySQLDatabase) GetTags() ([]model.Tag, error) + func (db *MySQLDatabase) RenameTag(id int, newName string) error + func (db *MySQLDatabase) SaveAccount(account model.Account) (err error) + func (db *MySQLDatabase) SaveBookmarks(bookmarks ...model.Bookmark) (result []model.Bookmark, err error) + type OrderMethod int + const ByLastAdded + const ByLastModified + const DefaultOrder + type PGDatabase struct + func OpenPGDatabase(connString string) (pgDB *PGDatabase, err error) + func (db *PGDatabase) CreateNewID(table string) (int, error) + func (db *PGDatabase) DeleteAccounts(usernames ...string) (err error) + func (db *PGDatabase) DeleteBookmarks(ids ...int) (err error) + func (db *PGDatabase) GetAccount(username string) (model.Account, bool) + func (db *PGDatabase) GetAccounts(opts GetAccountsOptions) ([]model.Account, error) + func (db *PGDatabase) GetBookmark(id int, url string) (model.Bookmark, bool) + func (db *PGDatabase) GetBookmarks(opts GetBookmarksOptions) ([]model.Bookmark, error) + func (db *PGDatabase) GetBookmarksCount(opts GetBookmarksOptions) (int, error) + func (db *PGDatabase) GetTags() ([]model.Tag, error) + func (db *PGDatabase) RenameTag(id int, newName string) error + func (db *PGDatabase) SaveAccount(account model.Account) (err error) + func (db *PGDatabase) SaveBookmarks(bookmarks ...model.Bookmark) (result []model.Bookmark, err error) + type SQLiteDatabase struct + func OpenSQLiteDatabase(databasePath string) (sqliteDB *SQLiteDatabase, err error) + func (db *SQLiteDatabase) CreateNewID(table string) (int, error) + func (db *SQLiteDatabase) DeleteAccounts(usernames ...string) (err error) + func (db *SQLiteDatabase) DeleteBookmarks(ids ...int) (err error) + func (db *SQLiteDatabase) GetAccount(username string) (model.Account, bool) + func (db *SQLiteDatabase) GetAccounts(opts GetAccountsOptions) ([]model.Account, error) + func (db *SQLiteDatabase) GetBookmark(id int, url string) (model.Bookmark, bool) + func (db *SQLiteDatabase) GetBookmarks(opts GetBookmarksOptions) ([]model.Bookmark, error) + func (db *SQLiteDatabase) GetBookmarksCount(opts GetBookmarksOptions) (int, error) + func (db *SQLiteDatabase) GetTags() ([]model.Tag, error) + func (db *SQLiteDatabase) RenameTag(id int, newName string) error + func (db *SQLiteDatabase) SaveAccount(account model.Account) (err error) + func (db *SQLiteDatabase) SaveBookmarks(bookmarks ...model.Bookmark) (result []model.Bookmark, err error)