Documentation ¶
Index ¶
- func ChangePassword(ctx *gin.Context, DB db.Database, userID string, ...)
- func Delete(ctx *gin.Context, DB db.Database, userID string)
- func GetMajors(ctx *gin.Context, DB db.Database, userID string)
- func GetTranscriptYears(ctx *gin.Context, DB db.Database, userID string)
- func InsertUser(DB db.Database, newUser *models.User, data *iddigital.Transcript) error
- func Login(ctx *gin.Context, DB db.Database, login *controllers.Login)
- func Logout(ctx *gin.Context)
- func Profile(ctx *gin.Context, DB db.Database, userID string)
- func RequestPasswordReset(ctx *gin.Context, DB db.Database, ...)
- func ResetPassword(ctx *gin.Context, DB db.Database, recovery *controllers.PasswordRecovery)
- func SearchCurriculum(ctx *gin.Context, DB db.Database, userID string, ...)
- func SearchTranscript(ctx *gin.Context, DB db.Database, userID string, ...)
- func Signup(ctx *gin.Context, DB db.Database, signupForm *controllers.SignupForm)
- func SignupCaptcha(ctx *gin.Context)
- func Update(ctx *gin.Context, DB db.Database, userID string, ...)
- func UpdateUser(ctx context.Context, DB db.Database, data *iddigital.Transcript, userID string, ...) error
- func VerifyAccount(ctx *gin.Context, DB db.Database, ...)
- func VerifyEmail(ctx *gin.Context, DB db.Database, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangePassword ¶
func ChangePassword(ctx *gin.Context, DB db.Database, userID string, resetForm *controllers.PasswordChange)
ChangePassword changes the user's password in the database This method requires the user to be logged in
func Delete ¶
Delete deletes the given user (removing all of its traces (grades, reviews, etc))
This function wraps the document lookups and simply performs the necessary database operations
func GetTranscriptYears ¶
GetTranscriptYears retrieves the last few years a user's has been in USP
func InsertUser ¶
InsertUser takes the user object and their transcripts and performs all the required database insertions
func Logout ¶
Logout is a dummy method that simply calls the view method that will unset the access token cookie
func RequestPasswordReset ¶
func RequestPasswordReset(ctx *gin.Context, DB db.Database, form *controllers.EmailVerificationSubmission)
RequestPasswordReset send a password reset link to the requested email
func ResetPassword ¶
func ResetPassword(ctx *gin.Context, DB db.Database, recovery *controllers.PasswordRecovery)
ResetPassword resets the user's password in the database
It differs from ChangePassword because it does not requires an access token
func SearchCurriculum ¶
func SearchCurriculum(ctx *gin.Context, DB db.Database, userID string, controller *controllers.CurriculumQuery)
SearchCurriculum queries the user's given major subjects and returns which ones they have completed and if so, their record information (grade, status and frequency)
func SearchTranscript ¶
func SearchTranscript(ctx *gin.Context, DB db.Database, userID string, controller *controllers.TranscriptQuery)
SearchTranscript takes a transcript query and retrieves its records with subject data attached to them
func Signup ¶
func Signup(ctx *gin.Context, DB db.Database, signupForm *controllers.SignupForm)
Signup performs all the server-side signup operations.
It validates database data, gets and parses user records, creates the user object and sends the verification email
func SignupCaptcha ¶
SignupCaptcha gets the iddigital validation captcha
func Update ¶
func Update(ctx *gin.Context, DB db.Database, userID string, updateForm *controllers.UpdateForm)
Update updates a user's profile with a new grade transcript
func UpdateUser ¶
func UpdateUser(ctx context.Context, DB db.Database, data *iddigital.Transcript, userID string, updateTime time.Time) error
UpdateUser takes a new transcript and updates the user stored data
It does a diff operation on the already stored grade transcript, adding new final scores to the user's data and updating subject records
func VerifyAccount ¶
func VerifyAccount(ctx *gin.Context, DB db.Database, verification *controllers.AccountVerification)
VerifyAccount sets the user's email as verified
func VerifyEmail ¶
func VerifyEmail(ctx *gin.Context, DB db.Database, emailForm *controllers.EmailVerificationSubmission)
VerifyEmail sends a new verification email
Types ¶
This section is empty.