Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlayerHandleFunc ¶
func PlayerHandleFunc(w http.ResponseWriter, r *http.Request)
Types ¶
type AuthHandler ¶
type AuthHandler struct { // Client is created as the result of Spotify backend calling auth callback, // as soon as spotify Client is created, the rest of the application can use // is to call any spotify apis. Client chan *spotify.Client // State is random string used in order to authenticate Client. It is used to // generate spotify backend URL to which user will be redirected. After user // comes back to the application (to the auth callback) it is used to verify // message received from the spotify backend. State string // used by auth callback to verify message from spotify backend // and to create a spotify Client. Authenticator SpotifyAuthenticatorInterface }
func (*AuthHandler) ServeHTTP ¶
func (s *AuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
authCallback is a function to by Spotify upon successful user login at their site
type WebPlaybackReadyDevice ¶
type WebPlaybackReadyDevice struct {
DeviceId string
}
type WebPlaybackState ¶
type WebsocketHandler ¶
type WebsocketHandler struct { // signal sent by the application to the websocket handler that triggers tear down // of websocket. PlayerShutdown chan bool // as soon as web player is ready it sends player device id as the very first // message on the websocket connection. Application may want to use this ID in // order to control on which player to play music (the one that it created, or // maybe on the other device that is also working) PlayerDeviceID chan spotify.ID // each time web player changes it's State it sens information about what is // currently played on the websocket PlayerStateChange chan *WebPlaybackState }
func (*WebsocketHandler) ServeHTTP ¶
func (s *WebsocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.