Move user properties (like session keys) to their own table
This commit is contained in:
+4
-3
@@ -27,11 +27,12 @@ type DataStore interface {
|
||||
Genre(ctx context.Context) GenreRepository
|
||||
Playlist(ctx context.Context) PlaylistRepository
|
||||
PlayQueue(ctx context.Context) PlayQueueRepository
|
||||
Property(ctx context.Context) PropertyRepository
|
||||
Share(ctx context.Context) ShareRepository
|
||||
User(ctx context.Context) UserRepository
|
||||
Transcoding(ctx context.Context) TranscodingRepository
|
||||
Player(ctx context.Context) PlayerRepository
|
||||
Share(ctx context.Context) ShareRepository
|
||||
Property(ctx context.Context) PropertyRepository
|
||||
User(ctx context.Context) UserRepository
|
||||
UserProps(ctx context.Context) UserPropsRepository
|
||||
|
||||
Resource(ctx context.Context, model interface{}) ResourceRepository
|
||||
|
||||
|
||||
+1
-5
@@ -1,14 +1,10 @@
|
||||
package model
|
||||
|
||||
const (
|
||||
// TODO Move other prop keys to here
|
||||
PropLastScan = "LastScan"
|
||||
)
|
||||
|
||||
type Property struct {
|
||||
ID string
|
||||
Value string
|
||||
}
|
||||
|
||||
type PropertyRepository interface {
|
||||
Put(id string, value string) error
|
||||
Get(id string) (string, error)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
// UserPropsRepository is meant to be scoped for the user, that can be obtained from request.UserFrom(r.Context())
|
||||
type UserPropsRepository interface {
|
||||
Put(key string, value string) error
|
||||
Get(key string) (string, error)
|
||||
Delete(key string) error
|
||||
DefaultGet(key string, defaultValue string) (string, error)
|
||||
}
|
||||
Reference in New Issue
Block a user