mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Move user properties (like session keys) to their own table
This commit is contained in:
parent
265f33ed9d
commit
5001518260
12 changed files with 248 additions and 46 deletions
|
@ -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,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)
|
||||
|
|
9
model/user_props.go
Normal file
9
model/user_props.go
Normal file
|
@ -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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue