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