Documentation
¶
Index ¶
- Constants
- Variables
- func ServeMessageSchemaJSON(w http.ResponseWriter, r *http.Request)
- func ServeResponseSchemaJSON(w http.ResponseWriter, r *http.Request)
- func ServeStatusRestJSON(w http.ResponseWriter, r *http.Request)
- func ServeStatusSchemaJSON(w http.ResponseWriter, r *http.Request)
- type Action
- type Message
- type Response
Constants ¶
Variables ¶
View Source
var AvailableCommands = []Action{ ActionGetStatus, ActionGetBuildInfo, ActionSetSinkVolume, ActionSetSinkMuted, ActionSetSinkInputVolume, ActionSetSinkInputMuted, ActionMoveSinkInput, ActionSetSourceVolume, ActionSetSourceMuted, ActionSetSourceInputVolume, ActionSetSourceInputMuted, ActionMoveSourceOutput, }
Functions ¶
func ServeMessageSchemaJSON ¶
func ServeMessageSchemaJSON(w http.ResponseWriter, r *http.Request)
func ServeResponseSchemaJSON ¶
func ServeResponseSchemaJSON(w http.ResponseWriter, r *http.Request)
func ServeStatusRestJSON ¶
func ServeStatusRestJSON(w http.ResponseWriter, r *http.Request)
func ServeStatusSchemaJSON ¶
func ServeStatusSchemaJSON(w http.ResponseWriter, r *http.Request)
Types ¶
type Action ¶
type Action string
const ( // Get composed informations about all sinks, sources, inputs and build ActionGetStatus Action = "GetStatus" // Metadata about build ActionGetBuildInfo Action = "GetBuildInfo" // SINKS, e.g. Speakers ActionSetSinkVolume Action = "SetSinkVolume" ActionSetSinkMuted Action = "SetSinkMuted" // Apps playing audio ActionSetSinkInputVolume Action = "SetSinkInputVolume" ActionSetSinkInputMuted Action = "SetSinkInputMuted" // Move App to different SINK ActionMoveSinkInput Action = "MoveSinkInput" // SOURCES, e.g. Microphones ActionSetSourceVolume Action = "SetSourceVolume" ActionSetSourceMuted Action = "SetSourceMuted" // Apps active access to microphones ActionSetSourceInputVolume Action = "SetSourceInputVolume" ActionSetSourceInputMuted Action = "SetSourceInputMuted" // Move App to different SOURCE ActionMoveSourceOutput Action = "MoveSourceOutput" )
type Message ¶
type Message struct {
// Actions listed in availableCommands slice
Action Action `` /* 271-byte string literal not displayed */
// Paylod send with Set* actions if necessary
Payload interface{} `json:"payload,omitempty" doc:"Paylod send with Set* actions if necessary"`
}
Message is an request from the client
type Response ¶
type Response struct {
// Action performed by API
Action string `json:"action" doc:"Action performed by API"`
// Status code
Status int16 `json:"status" doc:"Status code"`
// Response payload
Payload interface{} `json:"payload" doc:"Response payload"`
// Error description if any
Error string `json:"error,omitempty" doc:"Error description if any"`
}
func (Response) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.