mirror of
https://github.com/go-shiori/shiori.git
synced 2024-11-16 14:16:29 +08:00
20 lines
524 B
Go
20 lines
524 B
Go
package database
|
|
|
|
import (
|
|
"database/sql"
|
|
"github.com/RadhiFadlillah/go-readability"
|
|
"github.com/RadhiFadlillah/shiori/model"
|
|
)
|
|
|
|
type Database interface {
|
|
SaveBookmark(article readability.Article, tags ...string) (model.Bookmark, error)
|
|
GetBookmarks(indices ...string) ([]model.Bookmark, error)
|
|
DeleteBookmarks(indices ...string) ([]int, []int, error)
|
|
SearchBookmarks(keyword string, tags ...string) ([]model.Bookmark, error)
|
|
}
|
|
|
|
func checkError(err error) {
|
|
if err != nil && err != sql.ErrNoRows {
|
|
panic(err)
|
|
}
|
|
}
|