Documentation ¶
Index ¶
- func ChangePassword(ctx *gin.Context, DB db.Database, userID string, ...)
- func CompleteSignup(ctx *gin.Context, DB db.Database, signupForm *controllers.CompleteSignupForm)
- 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 PreSignup(ctx *gin.Context, DB db.Database, authForm *controllers.AuthForm)
- 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 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 CompleteSignup ¶ added in v1.5.5
func CompleteSignup(ctx *gin.Context, DB db.Database, signupForm *controllers.CompleteSignupForm)
CompleteSignup performs the server-side signup operations that can only be done after the user is created.
It validates the signup token, checks if the email is already in use and sends the verification email
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 PreSignup ¶ added in v1.5.5
PreSignup performs the server-side signup operations that can be done before the user is created.
It validates the access key, fetches the PDF, parses it and inserts the data into the database
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 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.