party

package
v0.0.0-...-8db1732 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteParty

func DeleteParty(party *Party) error

delete party from redis

func FindAll

func FindAll() (*[]Party, error)

retrieve party from redis

func IsPartyLive

func IsPartyLive(partyId string) (bool, error)

check if party is still live

Types

type Party

type Party struct {
	ID         string
	HostUserID string
}

func CreateParty

func CreateParty(host *User) *Party

create and persist a new party to Redis

func FindParty

func FindParty(partyId string) (*Party, error)

retrieve party from redis

func (*Party) Host

func (party *Party) Host()

go routine to publish currently playing track to redis

func (*Party) Join

func (party *Party) Join(user *User) error

go routine to subscribe to party channel and update currently playing track

func (*Party) Leave

func (party *Party) Leave(user *User)

leave from a party and unsubscribe from channel

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(store sessions.Store) *Server

func (*Server) Listen

func (server *Server) Listen(r *mux.Router)

type User

type User struct {
	ID    string
	Token *oauth2.Token
}

func CreateUser

func CreateUser(userID string, token *oauth2.Token) *User

create new user object and persist in redis

func FindUser

func FindUser(userId string) (*User, error)

retrieve user object from redis

func (*User) SpotifyClient

func (u *User) SpotifyClient() *spotify.Client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL