controllers

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountVerification

type AccountVerification struct {
	Token string `form:"token" binding:"required,validateVerificationToken"`
}

AccountVerification is the object used to verify a recently-registered account

type Comment

type Comment struct {
	Rating int    `json:"rating" binding:"required,gte=1,lte=5"`
	Body   string `json:"body" binding:"required,min=10,max=500"`
}

Comment is the object that holds an offering review comment. It must contain the message and the rating/reaction level.

type CommentRateBody

type CommentRateBody struct {
	Type string `json:"type" binding:"required,oneof=upvote downvote none"`
}

CommentRateBody is the object that holds the type when rating other users' comments

type CommentRating

type CommentRating struct {
	Offering
	ID string `form:"comment" binding:"required,uuid"`
}

CommentRating is the object used for identifying the comment being rated

type CommentReportBody

type CommentReportBody struct {
	Body string `json:"body" binding:"required,min=10,max=500"`
}

CommentReportBody is the object that holds the message when reporting users' comments

type Course

type Course struct {
	Institute string `form:"institute" binding:"required,alphanum"`

	Code           string `form:"course" binding:"required,alphanum"`
	Specialization string `form:"specialization" binding:"required,alphanum"`
}

Course is a controller to specify which course to get course data from

type CurriculumQuery

type CurriculumQuery struct {
	// Subject query data
	Course         string `form:"course" binding:"required"`
	Specialization string `form:"specialization" binding:"required"`
	Optional       bool   `form:"optional"`
	Semester       int    `form:"semester" binding:"required"`
}

CurriculumQuery is the object that holds data needed to search in a user's curriculum

type EmailVerificationSubmission

type EmailVerificationSubmission struct {
	Email string `json:"email" binding:"required,email,validateEmail"`
}

EmailVerificationSubmission is the object that holds the email used for account verification

type Institute

type Institute struct {
	Code string `form:"institute" binding:"required,alphanum"`
}

Institute is a query parameter to specify which institute to get course data from

type Login

type Login struct {
	ID       string `json:"login" binding:"required,numeric"`
	Password string `json:"pwd" binding:"required,validatePassword"`
	Remember bool   `json:"remember"`
}

Login is the object used for user authentication

type Major

type Major struct {
	Course         string `json:"course" binding:"required"`
	Specialization string `json:"specialization" binding:"required"`
}

Major is the object used for looking up a user's registered majors (for example BCC)

type Offering

type Offering struct {
	Subject
	Hash string `form:"professor" binding:"required,len=64,alphanum"` // sha256
}

Offering is the object used for looking up offerings, e.g., subjects in the context of a given professor.

type PasswordChange

type PasswordChange struct {
	OldPassword string `json:"old_password" binding:"required"`
	NewPassword string `json:"new_password" binding:"required,validatePassword,nefield=OldPassword"`
}

PasswordChange is the object used for changing a user's password.

It differs from PasswordRecovery because the user must be signed in.

type PasswordRecovery

type PasswordRecovery struct {
	Token    string `json:"token" binding:"required,validateRecoveryToken"`
	Password string `json:"password" binding:"required,validatePassword"`
}

PasswordRecovery is the object used for recovering a user's password.

It differs from PasswordRecovery because the user is not signed in. This is used when the user forgot/lost their password.

type SignupForm

type SignupForm struct {
	AccessKey string `json:"access_key" binding:"required,validateAccessKey"`
	Password  string `json:"password" binding:"required,validatePassword"`
	Captcha   string `json:"captcha" binding:"required,alphanum,len=4"`
	Email     string `json:"email" binding:"required,email,validateEmail"`
}

SignupForm is used for signing up a new user.

It contains information that is used to obtain user records (access key and captcha) It also contains information that will be used for later verification and authentication (email and password)

type Subject

type Subject struct {
	Code           string `form:"code" binding:"required,alphanum"`
	CourseCode     string `form:"course" binding:"required,alphanum"`
	Specialization string `form:"specialization" binding:"required,alphanum"`

	Limit int `form:"limit"`
}

Subject is the object used for looking up subject data. It is probably one of the most used controllers

It also holds a property "limit", used for filtering offering results

type SubjectReview

type SubjectReview struct {
	Subject
	Review map[string]interface{} `json:"categories" binding:"required,validateSubjectReview"`
}

SubjectReview is the object used for evaluating a subject, without the context of a professor

type TranscriptQuery

type TranscriptQuery struct {
	Year     int `form:"year" binding:"required"`
	Semester int `form:"semester" binding:"required,oneof=1 2"`
}

TranscriptQuery is the object used for querying a user's transcript

type UpdateForm

type UpdateForm struct {
	AccessKey string `json:"access_key" binding:"required,validateAccessKey"`
	Captcha   string `json:"captcha" binding:"required,alphanum,len=4"`
}

UpdateForm is used for updating a user's profile.

It contains information that is used to obtain user records (access key and captcha)

Jump to

Keyboard shortcuts

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