shiori/database/database.go
2018-01-31 10:59:27 +07:00

20 lines
517 B
Go

package database
import (
"database/sql"
"github.com/RadhiFadlillah/shiori/model"
)
type Database interface {
SaveBookmark(bookmark model.Bookmark) (int64, error)
GetBookmarks(indices ...string) ([]model.Bookmark, error)
DeleteBookmarks(indices ...string) ([]int, []int, error)
SearchBookmarks(keyword string, tags ...string) ([]model.Bookmark, error)
GetBookmarksContent(indices ...string) ([]model.Bookmark, error)
}
func checkError(err error) {
if err != nil && err != sql.ErrNoRows {
panic(err)
}
}