add storage interface, fix all references

This commit is contained in:
nkanaev
2026-06-10 22:24:04 +01:00
parent 3f10371975
commit f2556178b3
9 changed files with 65 additions and 57 deletions

View File

@@ -1,12 +1,12 @@
package factory
package storage
import (
"github.com/nkanaev/yarr/src/storage/model"
"github.com/nkanaev/yarr/src/storage/sqlite"
)
type Storage interface {
Close() error
Migrate() error
CountItems() int
CreateFeed(params model.CreateFeedParams) *model.Feed
CreateFolder(title string) *model.Folder
@@ -30,3 +30,7 @@ type Storage interface {
UpdateItemStatus(item_id int64, status model.ItemStatus) bool
UpdateSettings(params model.UpdateSettingsParams) bool
}
func New(path string) (Storage, error) {
return sqlite.New(path)
}