Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caching to server #2

Open
tdakkota opened this issue Mar 21, 2020 · 0 comments
Open

Add caching to server #2

tdakkota opened this issue Mar 21, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tdakkota
Copy link
Owner

gnhentai-server provides Cache interface

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
}

You can use gokv package for example(original package does not support expiration, see this issue)

@tdakkota tdakkota added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant