2020-01-15 04:22:34 +01:00
|
|
|
package model
|
2016-03-02 15:33:49 +01:00
|
|
|
|
2020-01-19 21:37:41 +01:00
|
|
|
import (
|
2020-01-27 15:41:33 +01:00
|
|
|
"context"
|
|
|
|
|
2020-01-31 03:48:07 +01:00
|
|
|
"github.com/Masterminds/squirrel"
|
2020-01-20 02:40:18 +01:00
|
|
|
"github.com/deluan/rest"
|
2020-01-19 21:37:41 +01:00
|
|
|
)
|
2016-03-18 16:33:50 +01:00
|
|
|
|
2016-03-04 04:44:28 +01:00
|
|
|
type QueryOptions struct {
|
2020-01-20 04:36:15 +01:00
|
|
|
Sort string
|
|
|
|
Order string
|
|
|
|
Max int
|
2020-01-16 05:49:20 +01:00
|
|
|
Offset int
|
2020-01-31 03:48:07 +01:00
|
|
|
Filters squirrel.Sqlizer
|
2016-03-04 04:44:28 +01:00
|
|
|
}
|
2020-01-19 21:37:41 +01:00
|
|
|
|
2020-01-20 02:40:18 +01:00
|
|
|
type ResourceRepository interface {
|
|
|
|
rest.Repository
|
|
|
|
}
|
|
|
|
|
2020-01-19 21:37:41 +01:00
|
|
|
type DataStore interface {
|
2020-01-27 15:41:33 +01: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 19:07:39 +02:00
|
|
|
PlayQueue(ctx context.Context) PlayQueueRepository
|
2020-01-27 15:41:33 +01:00
|
|
|
Property(ctx context.Context) PropertyRepository
|
|
|
|
User(ctx context.Context) UserRepository
|
2020-03-01 02:01:09 +01:00
|
|
|
Transcoding(ctx context.Context) TranscodingRepository
|
|
|
|
Player(ctx context.Context) PlayerRepository
|
2020-01-19 21:37:41 +01:00
|
|
|
|
2020-01-27 15:41:33 +01:00
|
|
|
Resource(ctx context.Context, model interface{}) ResourceRepository
|
2020-01-20 02:40:18 +01:00
|
|
|
|
2020-01-19 21:37:41 +01:00
|
|
|
WithTx(func(tx DataStore) error) error
|
2020-02-01 02:17:36 +01:00
|
|
|
GC(ctx context.Context) error
|
2020-01-19 21:37:41 +01:00
|
|
|
}
|