Documentation ¶
Index ¶
- type AccountVerification
- type AuthForm
- type Comment
- type CommentRateBody
- type CommentRating
- type CommentReportBody
- type CompleteSignupForm
- type Course
- type CurriculumQuery
- type EmailVerificationSubmission
- type Institute
- type InstituteCourse
- type Login
- type Major
- type Offering
- type PasswordChange
- type PasswordRecovery
- type Subject
- type SubjectReview
- type TranscriptQuery
- type UpdateForm
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 AuthForm ¶ added in v1.5.5
type AuthForm struct {
AccessKey string `json:"access_key" binding:"required,validateAccessKey"`
}
AuthForm is used for the first step of the signup process.
It contains information that is used to obtain the users' records through their access key.
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 ¶
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 CompleteSignupForm ¶ added in v1.5.5
type CompleteSignupForm struct { Password string `json:"password" binding:"required,validatePassword"` Email string `json:"email" binding:"required,email,validateEmail"` SignupToken string `json:"signup_token" binding:"required,validateSignupToken"` }
CompleteSignupForm is used for completing a user's signup.
Signup is a two-step process. First the user provides the access key which is used to obtain the signup token. Then the user provides the signup token and the rest of the information to complete the signup.
type Course ¶
type Course struct { 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
It differs from Course in that it does not require an institute
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 InstituteCourse ¶ added in v1.6.1
type InstituteCourse struct { Institute string `form:"institute" binding:"required,alphanum"` Course }
InstituteCourse is a controller to specify which course 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 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"`
}
UpdateForm is used for updating a user's profile.
It contains information that is used to obtain user records (captcha)