shiori/database/database.go

21 lines
524 B
Go
Raw Normal View History

package database
import (
2018-01-29 16:00:37 +08:00
"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)
2018-01-29 08:40:29 +08:00
DeleteBookmarks(indices ...string) ([]int, []int, error)
2018-01-29 21:45:27 +08:00
SearchBookmarks(keyword string, tags ...string) ([]model.Bookmark, error)
}
func checkError(err error) {
2018-01-29 16:00:37 +08:00
if err != nil && err != sql.ErrNoRows {
panic(err)
}
}