add download handler

This commit is contained in:
rmanach
2025-01-07 11:53:14 +01:00
parent 5e805b5b4d
commit ee52a1b4f2
6 changed files with 68 additions and 10 deletions
+5
View File
@@ -24,6 +24,7 @@ var (
type IStore interface {
Save(bm *BookMetadata, content io.ReadCloser) error
Search(value string) ([]BookMetadata, error)
GetStoreDir() string
}
var _ IStore = (*BookStore)(nil)
@@ -168,6 +169,10 @@ func (bs *BookStore) Done() <-chan struct{} {
return chDone
}
func (bs *BookStore) GetStoreDir() string {
return bs.dir
}
func (bs *BookStore) Save(bm *BookMetadata, content io.ReadCloser) error {
bs.processing.Add(1)
defer bs.processing.Done()