-
Notifications
You must be signed in to change notification settings - Fork 1
/
cache.go
29 lines (21 loc) · 840 Bytes
/
cache.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package server
import (
"github.com/tdakkota/gnhentai"
"io"
)
type Cache interface {
GetDoujinshi(bookID int) (gnhentai.Doujinshi, error)
SetDoujinshi(bookID int, d gnhentai.Doujinshi) error
GetPage(bookID, n int) (io.ReadCloser, error)
SetPage(bookID int, image io.ReadCloser) error
GetCover(bookID int) (io.ReadCloser, error)
SetCover(bookID int, image io.ReadCloser) error
GetThumbnail(bookID int) (io.ReadCloser, error)
SetThumbnail(bookID int, image io.ReadCloser) error
Search(q string) ([]gnhentai.Doujinshi, error)
SetSearch(q string, result []gnhentai.Doujinshi) error
SearchByTag(tag gnhentai.Tag) ([]gnhentai.Doujinshi, error)
SetSearchByTag(tag gnhentai.Tag, result []gnhentai.Doujinshi) error
Related(bookID int) ([]gnhentai.Doujinshi, error)
SetRelated(bookID int, result []gnhentai.Doujinshi) error
}