|
@@ -26,18 +26,17 @@ type Member struct {
|
|
|
// an action across first should cause the other to obey the instruction
|
|
// an action across first should cause the other to obey the instruction
|
|
|
// and treat the first as master.
|
|
// and treat the first as master.
|
|
|
//
|
|
//
|
|
|
-// The master client is responsible for:
|
|
|
|
|
-// 1. Playing the music
|
|
|
|
|
-// 2. Keeping the server updated regularly about the current state
|
|
|
|
|
|
|
+// The master client is responsible for keeping the server updated regularly about the current state
|
|
|
//
|
|
//
|
|
|
// This type here is merely used for validation of client state messages.
|
|
// This type here is merely used for validation of client state messages.
|
|
|
// Each client implementation MUST adhere to this spec.
|
|
// Each client implementation MUST adhere to this spec.
|
|
|
|
|
|
|
|
type MusicPlayer struct {
|
|
type MusicPlayer struct {
|
|
|
- SongId *int `json:"songId" validate:"omitempty,gte=1"`
|
|
|
|
|
- Playing bool `json:"playing" validate:"-"`
|
|
|
|
|
- CurrentTime float32 `json:"currentTime" validate:"gte=0"`
|
|
|
|
|
- SeekTime float32 `json:"seekTime" validate:"min=-1"`
|
|
|
|
|
- Master string `json:"master" validate:"required"`
|
|
|
|
|
- Queue *[]int `json:"queue" validate:"required"`
|
|
|
|
|
|
|
+ SongId *int `json:"songId" validate:"omitempty,gte=1"`
|
|
|
|
|
+ Playing bool `json:"playing" validate:"-"`
|
|
|
|
|
+ CurrentTime float32 `json:"currentTime" validate:"gte=0"`
|
|
|
|
|
+ SeekTime float32 `json:"seekTime" validate:"min=-1"`
|
|
|
|
|
+ Master string `json:"master" validate:"required"`
|
|
|
|
|
+ ActiveClients *[]string `json:"activeClients" validate:"required"`
|
|
|
|
|
+ Queue *[]int `json:"queue" validate:"required"`
|
|
|
}
|
|
}
|