mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-18 12:57:41 +03:00
- Create model.DataStore, with provision for transactions - Change all layers dependencies on repositories to use DataStore - Implemented persistence.SQLStore - Removed iTunes Bridge/Importer support
36 lines
794 B
Go
36 lines
794 B
Go
package model
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var (
|
|
ErrNotFound = errors.New("data not found")
|
|
)
|
|
|
|
// Filters use the same operators as Beego ORM: See https://beego.me/docs/mvc/model/query.md#operators
|
|
// Ex: var q = QueryOptions{Filters: Filters{"name__istartswith": "Deluan","age__gt": 25}}
|
|
// All conditions will be ANDed together
|
|
// TODO Implement filter in repositories' methods
|
|
type Filters map[string]interface{}
|
|
|
|
type QueryOptions struct {
|
|
SortBy string
|
|
Desc bool
|
|
Offset int
|
|
Size int
|
|
Filters Filters
|
|
}
|
|
|
|
type DataStore interface {
|
|
Album() AlbumRepository
|
|
Artist() ArtistRepository
|
|
MediaFile() MediaFileRepository
|
|
MediaFolder() MediaFolderRepository
|
|
Genre() GenreRepository
|
|
Playlist() PlaylistRepository
|
|
Property() PropertyRepository
|
|
|
|
WithTx(func(tx DataStore) error) error
|
|
}
|