123456789101112131415161718192021222324252627282930 |
- package main
- import (
- "encoding/json"
- "net/http"
- )
- type Status struct {
- Playing bool //If the device is playing
- PlayingFileName string //The playing filename
- PlayingFileURL string //The playing URL
- PlayingPosition int //The number of seconds that is currently playing
- Volume int //The volume currently is playing at, in percentage
- Status string //Status of the device, support {downloading, converting, playing, paused, ready}
- }
- func handleIndex(w http.ResponseWriter, r *http.Request) {
- //Serve the index
- sendOK(w)
- }
- func handleStatus(w http.ResponseWriter, r *http.Request) {
- //Send out the current device status
- js, _ := json.Marshal(deviceStatus)
- sendJSONResponse(w, string(js))
- }
- func handleEndpoints(w http.ResponseWriter, r *http.Request) {
- }
|