2020-01-14 22:22:34 -05:00
|
|
|
package model
|
2016-03-02 09:33:49 -05:00
|
|
|
|
2020-01-19 15:37:41 -05:00
|
|
|
import (
|
2020-01-27 09:41:33 -05:00
|
|
|
"context"
|
|
|
|
|
|
2020-01-30 21:48:07 -05:00
|
|
|
"github.com/Masterminds/squirrel"
|
2020-01-19 20:40:18 -05:00
|
|
|
"github.com/deluan/rest"
|
2020-01-19 15:37:41 -05:00
|
|
|
)
|
2016-03-18 11:33:50 -04:00
|
|
|
|
2016-03-03 22:44:28 -05:00
|
|
|
type QueryOptions struct {
|
2020-01-19 22:36:15 -05:00
|
|
|
Sort string
|
|
|
|
|
Order string
|
|
|
|
|
Max int
|
2020-01-15 23:49:20 -05:00
|
|
|
Offset int
|
2020-01-30 21:48:07 -05:00
|
|
|
Filters squirrel.Sqlizer
|
2016-03-03 22:44:28 -05:00
|
|
|
}
|
2020-01-19 15:37:41 -05:00
|
|
|
|
2020-01-19 20:40:18 -05:00
|
|
|
type ResourceRepository interface {
|
|
|
|
|
rest.Repository
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-19 15:37:41 -05:00
|
|
|
type DataStore interface {
|
2020-01-27 09:41:33 -05: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 13:07:39 -04:00
|
|
|
PlayQueue(ctx context.Context) PlayQueueRepository
|
2020-02-29 20:01:09 -05:00
|
|
|
Transcoding(ctx context.Context) TranscodingRepository
|
|
|
|
|
Player(ctx context.Context) PlayerRepository
|
2023-01-15 20:11:37 +00:00
|
|
|
Radio(ctx context.Context) RadioRepository
|
2021-06-23 16:47:32 -04:00
|
|
|
Share(ctx context.Context) ShareRepository
|
|
|
|
|
Property(ctx context.Context) PropertyRepository
|
|
|
|
|
User(ctx context.Context) UserRepository
|
|
|
|
|
UserProps(ctx context.Context) UserPropsRepository
|
2021-06-24 00:01:05 -04:00
|
|
|
ScrobbleBuffer(ctx context.Context) ScrobbleBufferRepository
|
2020-01-19 15:37:41 -05:00
|
|
|
|
2020-01-27 09:41:33 -05:00
|
|
|
Resource(ctx context.Context, model interface{}) ResourceRepository
|
2020-01-19 20:40:18 -05:00
|
|
|
|
2020-01-19 15:37:41 -05:00
|
|
|
WithTx(func(tx DataStore) error) error
|
2020-10-02 16:18:45 -04:00
|
|
|
GC(ctx context.Context, rootFolder string) error
|
2020-01-19 15:37:41 -05:00
|
|
|
}
|