controller

package
v0.0.0-...-5fc1a02 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2016 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Achievements

func Achievements(staticDir string) http.Handler

func CurrentUser

func CurrentUser(w http.ResponseWriter, r *http.Request)

CurrentUser returns the username of the session's user

func GetAISource

func GetAISource() http.Handler

func GetAchievements

func GetAchievements(staticDir string) http.Handler

func GetToken

func GetToken(r *http.Request) (string, error)

func GetUserName

func GetUserName(r *http.Request) (string, error)

func IsUserAuthorised

func IsUserAuthorised(r *http.Request) bool

func Leaderboard

func Leaderboard(staticDir string) http.Handler

func LeaderboardPeek

func LeaderboardPeek(w http.ResponseWriter, r *http.Request)

Get the top 10 global values from the database and returns them in a JSON format

func LobbiesCreate

func LobbiesCreate(config *config.Config) http.Handler

func LobbiesGame

func LobbiesGame(staticDir string) http.Handler

func LobbiesGetUsers

func LobbiesGetUsers(w http.ResponseWriter, r *http.Request)

LobbiesGetUsers gets all the user names from the lobby specified at the end of the caught URL, and returns them as a JSON

func LobbiesJoin

func LobbiesJoin(w http.ResponseWriter, r *http.Request)

func LobbiesLeaderboard

func LobbiesLeaderboard(w http.ResponseWriter, r *http.Request)

func LobbiesLeave

func LobbiesLeave(w http.ResponseWriter, r *http.Request)

LobbiesLeave temporarily logs the user out - this will change in the future

func LobbiesMessage

func LobbiesMessage(w http.ResponseWriter, r *http.Request)

func LobbiesName

func LobbiesName(w http.ResponseWriter, r *http.Request)

func LobbiesPeek

func LobbiesPeek(w http.ResponseWriter, r *http.Request)

LobbiesPeek returns all the lobbies serialized as JSON

func LobbiesSummary

func LobbiesSummary(staticDir string) http.Handler

func LobbiesView

func LobbiesView(staticDir string) http.Handler

func LogInPage

func LogInPage(staticDir string) http.Handler

func Logout

func Logout(w http.ResponseWriter, r *http.Request)

Logout deletes the user session

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

NotFound is called when a request URI does not exist

func OAuthSignInCallback

func OAuthSignInCallback(w http.ResponseWriter, r *http.Request)

OAuthSignInCallback gets the access token from the Github API and uses it to get/create a user

func PingHandler

func PingHandler(w http.ResponseWriter, r *http.Request)

PingHandler is used for responsiveness checks

func PostAISource

func PostAISource() http.Handler

func RequireAuth

func RequireAuth(h http.Handler) http.Handler

func SVGSpriteHandler

func SVGSpriteHandler(staticDir string) http.Handler

func UpdateMaxAge

func UpdateMaxAge(h http.Handler) http.Handler

UpdateMaxAge resets the MaxAge of the session to keep the user logged in

func UpdatesHandler

func UpdatesHandler() http.Handler

func UserLogIn

func UserLogIn(w http.ResponseWriter, r *http.Request)

UserLogIn signs the user in and sets up a session

func UserToken

func UserToken(w http.ResponseWriter, r *http.Request)

Types

This section is empty.

Jump to

Keyboard shortcuts

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