2016-03-16 20:27:48 -04:00
|
|
|
package engine
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
2016-03-17 17:35:10 -04:00
|
|
|
const NowPlayingExpire = time.Duration(60) * time.Minute
|
2016-03-16 20:27:48 -04:00
|
|
|
|
|
|
|
|
type NowPlayingInfo struct {
|
2016-03-17 09:34:32 -04:00
|
|
|
TrackId string
|
|
|
|
|
Start time.Time
|
|
|
|
|
Username string
|
|
|
|
|
PlayerId int
|
|
|
|
|
PlayerName string
|
2016-03-16 20:27:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type NowPlayingRepository interface {
|
2016-03-17 09:34:32 -04:00
|
|
|
Set(trackId, username string, playerId int, playerName string) error
|
2016-03-17 18:58:09 -04:00
|
|
|
Clear(playerId int) (*NowPlayingInfo, error)
|
2016-03-17 09:34:32 -04:00
|
|
|
GetAll() (*[]NowPlayingInfo, error)
|
2016-03-16 20:27:48 -04:00
|
|
|
}
|