Documentation ¶
Index ¶
- func GetLeaderBoard(w http.ResponseWriter, r *http.Request)
- func Init(db *sql.DB)
- type Auth
- func (a *Auth) Cu(rw http.ResponseWriter, req *http.Request)
- func (a *Auth) GetUser(rw http.ResponseWriter, req *http.Request) *httpauth.UserData
- func (a *Auth) HandleLogout(rw http.ResponseWriter, req *http.Request)
- func (a *Auth) PostLogin(rw http.ResponseWriter, req *http.Request)
- func (a *Auth) PostRegister(rw http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLeaderBoard ¶
func GetLeaderBoard(w http.ResponseWriter, r *http.Request)
GetLeaderBoard returns a json array of the current top 10 winners
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth controls the authorization of users
func NewAuth ¶
func NewAuth(s settings.PaoSettings) (a *Auth, e error)
NewAuth returns a new Auth for authenticating users
func (*Auth) Cu ¶
func (a *Auth) Cu(rw http.ResponseWriter, req *http.Request)
Cu returns the current logged-in user's name (if any)
func (*Auth) HandleLogout ¶
func (a *Auth) HandleLogout(rw http.ResponseWriter, req *http.Request)
HandleLogout logs the current user out
func (*Auth) PostLogin ¶
func (a *Auth) PostLogin(rw http.ResponseWriter, req *http.Request)
PostLogin handles logins to the site
func (*Auth) PostRegister ¶
func (a *Auth) PostRegister(rw http.ResponseWriter, req *http.Request)
PostRegister handles a new registration
Click to show internal directories.
Click to hide internal directories.