Documentation ¶
Index ¶
- func SetCache(c cache.Store)
- func SetSpotifyAuth(spotifyAuth spotify.Authenticator, spotifyDefaultAuth clientcredentials.Config)
- type Auth
- func (cr *Auth) Finished() gin.HandlerFunc
- func (cr *Auth) GetToken() gin.HandlerFunc
- func (cr *Auth) GuestPing() gin.HandlerFunc
- func (cr *Auth) Login() gin.HandlerFunc
- func (cr *Auth) Logout() gin.HandlerFunc
- func (cr *Auth) Mobile() gin.HandlerFunc
- func (cr *Auth) SpotifyCallback() gin.HandlerFunc
- type Controller
- type Events
- type History
- type Index
- type Party
- type Playback
- type Playlists
- type Queue
- type Search
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetSpotifyAuth ¶
func SetSpotifyAuth(spotifyAuth spotify.Authenticator, spotifyDefaultAuth clientcredentials.Config)
SetSpotifyAuth sets the Spotify client factories used by controllers
Types ¶
type Auth ¶
type Auth struct { Controller // contains filtered or unexported fields }
Auth controller for Party authentication
func (*Auth) Finished ¶
func (cr *Auth) Finished() gin.HandlerFunc
Finished displays a success message and is suitable for detection in mobile app
func (*Auth) GetToken ¶
func (cr *Auth) GetToken() gin.HandlerFunc
GetToken retreives the Spotify access token for the current user
func (*Auth) GuestPing ¶
func (cr *Auth) GuestPing() gin.HandlerFunc
GuestPing replies to a guest's ping request with "pong"
func (*Auth) Login ¶
func (cr *Auth) Login() gin.HandlerFunc
Login to Party via Spotify's Authorization Grant OAuth flow
func (*Auth) Logout ¶
func (cr *Auth) Logout() gin.HandlerFunc
Logout the current user, if logged in
func (*Auth) Mobile ¶
func (cr *Auth) Mobile() gin.HandlerFunc
Mobile responds with a pretty spinner for mobile client users
func (*Auth) SpotifyCallback ¶
func (cr *Auth) SpotifyCallback() gin.HandlerFunc
SpotifyCallback completes Spotify's Authorization Grant OAuth flow
type Controller ¶
type Controller struct { Cache cache.Store SpotifyAuth spotify.Authenticator SpotifyDefaultAuth clientcredentials.Config }
Controller template
func (*Controller) ClientFromSession ¶
ClientFromSession gets a Spotify client from the session's user
func (*Controller) RequestURI ¶
func (cr *Controller) RequestURI(c *gin.Context) string
RequestURI gets the full request URI given a Gin request context
func (*Controller) Setup ¶
func (cr *Controller) Setup()
Setup a Controller with a Party cache store and Spotify client factories
type History ¶
type History struct {
Controller
}
History controller
func (*History) Get ¶
func (cr *History) Get() gin.HandlerFunc
Get the current user's party's History
type Party ¶
type Party struct {
Controller
}
Party controller
func (*Party) PruneExpiredGuests ¶
func (cr *Party) PruneExpiredGuests()
PruneExpiredGuests from active parties every five seconds
func (*Party) Start ¶
func (cr *Party) Start() gin.HandlerFunc
Start a new party for the current user
type Playback ¶
type Playback struct {
Controller
}
Playback controller
func (*Playback) Pause ¶
func (cr *Playback) Pause() gin.HandlerFunc
Pause the party's playlist from playing
func (*Playback) Play ¶
func (cr *Playback) Play() gin.HandlerFunc
Play the party's playlist or resume from paused state
type Playlists ¶
type Playlists struct {
Controller
}
Playlists controller
func (*Playlists) Get ¶
func (cr *Playlists) Get() gin.HandlerFunc
Get the user's (host's) current playlist
func (*Playlists) Patch ¶
func (cr *Playlists) Patch() gin.HandlerFunc
Patch the current playlist via the new playlist's Spotify ID
type Search ¶
type Search struct {
Controller
}
Search controller
func (*Search) SearchTracks ¶
func (cr *Search) SearchTracks() gin.HandlerFunc
SearchTracks searches for Spotify tracks given a query string