db

package
v0.0.0-...-80078d4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

func Init

func Init(db *sql.DB)

Init initializes the database with necessary tables

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) GetUser

func (a *Auth) GetUser(rw http.ResponseWriter, req *http.Request) *httpauth.UserData

GetUser returns the currently logged in user (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

Jump to

Keyboard shortcuts

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