2020-01-14 18:22:34 -09:00
|
|
|
package model
|
2016-03-02 05:33:49 -09:00
|
|
|
|
2020-01-19 11:37:41 -09:00
|
|
|
import (
|
2020-01-27 05:41:33 -09:00
|
|
|
"context"
|
|
|
|
|
|
2020-01-30 17:48:07 -09:00
|
|
|
"github.com/Masterminds/squirrel"
|
2020-01-19 16:40:18 -09:00
|
|
|
"github.com/deluan/rest"
|
2020-01-19 11:37:41 -09:00
|
|
|
)
|
2016-03-18 07:33:50 -08:00
|
|
|
|
2016-03-03 18:44:28 -09:00
|
|
|
type QueryOptions struct {
|
2020-01-19 18:36:15 -09:00
|
|
|
Sort string
|
|
|
|
|
Order string
|
|
|
|
|
Max int
|
2020-01-15 19:49:20 -09:00
|
|
|
Offset int
|
2020-01-30 17:48:07 -09:00
|
|
|
Filters squirrel.Sqlizer
|
2016-03-03 18:44:28 -09:00
|
|
|
}
|
2020-01-19 11:37:41 -09:00
|
|
|
|
2020-01-19 16:40:18 -09:00
|
|
|
type ResourceRepository interface {
|
|
|
|
|
rest.Repository
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-19 11:37:41 -09:00
|
|
|
type DataStore interface {
|
2020-01-27 05:41:33 -09:00
|
|
|
Album(ctx context.Context) AlbumRepository
|
|
|
|
|
Artist(ctx context.Context) ArtistRepository
|
|
|
|
|
MediaFile(ctx context.Context) MediaFileRepository
|
|
|
|
|
MediaFolder(ctx context.Context) MediaFolderRepository
|
|
|
|
|
Genre(ctx context.Context) GenreRepository
|
|
|
|
|
Playlist(ctx context.Context) PlaylistRepository
|
2020-07-31 09:07:39 -08:00
|
|
|
PlayQueue(ctx context.Context) PlayQueueRepository
|
2020-02-29 16:01:09 -09:00
|
|
|
Transcoding(ctx context.Context) TranscodingRepository
|
|
|
|
|
Player(ctx context.Context) PlayerRepository
|
2021-06-23 12:47:32 -08:00
|
|
|
Share(ctx context.Context) ShareRepository
|
|
|
|
|
Property(ctx context.Context) PropertyRepository
|
|
|
|
|
User(ctx context.Context) UserRepository
|
|
|
|
|
UserProps(ctx context.Context) UserPropsRepository
|
2021-06-23 20:01:05 -08:00
|
|
|
ScrobbleBuffer(ctx context.Context) ScrobbleBufferRepository
|
2020-01-19 11:37:41 -09:00
|
|
|
|
2020-01-27 05:41:33 -09:00
|
|
|
Resource(ctx context.Context, model interface{}) ResourceRepository
|
2020-01-19 16:40:18 -09:00
|
|
|
|
2020-01-19 11:37:41 -09:00
|
|
|
WithTx(func(tx DataStore) error) error
|
2020-10-02 12:18:45 -08:00
|
|
|
GC(ctx context.Context, rootFolder string) error
|
2020-01-19 11:37:41 -09:00
|
|
|
}
|