Documentation ¶
Index ¶
- func ActivateAccount(w http.ResponseWriter, r *http.Request)
- func ActivateTokenInDB(db *sql.DB, token string) error
- func Authenticating(w http.ResponseWriter, r *http.Request)
- func EmailIsValid(email string) bool
- func GetHost(db *sql.DB) (string, error)
- func GetMailSender(db *sql.DB) (string, error)
- func GetPasswordHashFromUsername(db *sql.DB, username string) (string, error)
- func GetPostmarkClient(db *sql.DB) (*postmark.Client, error)
- func GetRegistrationMailSubject(db *sql.DB) (string, error)
- func GetUserIDFromUsername(db *sql.DB, username string) (int, error)
- func InsertActivationToken(db *sql.DB, userID int64, activationToken string) error
- func InsertNewUser(db *sql.DB, email string, username string, password string) (int64, error)
- func SetSessionUsername(w http.ResponseWriter, r *http.Request, username string) error
- func SignIn(w http.ResponseWriter, r *http.Request)
- func SignOut(w http.ResponseWriter, r *http.Request)
- func SignUp(w http.ResponseWriter, r *http.Request)
- func SignUpNewUser(w http.ResponseWriter, r *http.Request)
- type Page
- type VerificationMail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivateAccount ¶
func ActivateAccount(w http.ResponseWriter, r *http.Request)
ActivateAccount gets the userID from database that matches the username variable sent in.
func ActivateTokenInDB ¶
ActivateTokenInDB ...
func Authenticating ¶
func Authenticating(w http.ResponseWriter, r *http.Request)
Authenticating endpoint parses the form data the user sent in and authenticates the user if it is valid.
func EmailIsValid ¶
EmailIsValid checks if the email is valid and returns it in boolean form.
func GetMailSender ¶
GetMailSender gets the MailSender value in the settings table in the database.
func GetPasswordHashFromUsername ¶
GetPasswordHashFromUsername returns the password hash from the database associated with the username sent in.
func GetPostmarkClient ¶
GetPostmarkClient gets the PostmarkToken value in the settings table in the database.
func GetRegistrationMailSubject ¶
GetRegistrationMailSubject gets the RegistrationMailSubject value in the settings table in the database.
func GetUserIDFromUsername ¶
GetUserIDFromUsername gets the userID from database that matches the username variable sent in.
func InsertActivationToken ¶
InsertActivationToken inserts the activation token into the database
func InsertNewUser ¶
InsertNewUser inserts the user into the database.
func SetSessionUsername ¶
SetSessionUsername sets the session username for the user to the username variable sent in.
func SignIn ¶
func SignIn(w http.ResponseWriter, r *http.Request)
SignIn endpoint displays a HTML page.
func SignOut ¶
func SignOut(w http.ResponseWriter, r *http.Request)
SignOut endpoint removes the username from the session.
func SignUp ¶
func SignUp(w http.ResponseWriter, r *http.Request)
SignUp endpoint returns the Sign up HTML page.
func SignUpNewUser ¶
func SignUpNewUser(w http.ResponseWriter, r *http.Request)
SignUpNewUser endpoint parses the form for signing up and inserts the user into the database and sends a verification email.
Types ¶
type VerificationMail ¶
VerificationMail contains the data to render the verification mail HTML page.