Documentation ¶
Index ¶
- Variables
- type Admin
- func (a *Admin) CheckPasswordStrength(password string) bool
- func (a *Admin) ComparePasswords(password string) bool
- func (a *Admin) EmailExists(email string) bool
- func (a *Admin) GeneratePassword(passwordLength, minSpecialChar, minNum, minUpperCase int) string
- func (a *Admin) GenerateSchoolEmail(offset int, lastEmail string) string
- func (s *Admin) HashPassword(password string) string
- type Contact
- type Course
- type Id
- type Locker
- type Photo
- type Student
- func (s *Student) CheckPasswordStrength(password string) bool
- func (s *Student) ComparePasswords(password string) bool
- func (s *Student) EmailExists(email string) bool
- func (s *Student) GeneratePassword(passwordLength, minSpecialChar, minNum, minUpperCase int) string
- func (s *Student) GenerateSchoolEmail(offset int, lastEmail string) string
- func (s *Student) HashPassword(password string) string
- func (s *Student) UsedPassword(password string) bool
- type Teacher
- func (t *Teacher) CheckPasswordStrength(password string) bool
- func (t *Teacher) ComparePasswords(password string) bool
- func (t *Teacher) EmailExists(email string) bool
- func (t *Teacher) GeneratePassword(passwordLength, minSpecialChar, minNum, minUpperCase int) string
- func (t *Teacher) GenerateSchoolEmail(offset int, lastEmail string) string
- func (t *Teacher) HashPassword(password string) string
- func (t *Teacher) UsedPassword(password string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var AdminCollection *mongo.Collection = database.OpenCollection(database.Client, "admins")
View Source
var LockerCollection *mongo.Collection = database.OpenCollection(database.Client, "lockers")
View Source
var StudentCollection *mongo.Collection = database.OpenCollection(database.Client, "students")
View Source
var TeacherCollection *mongo.Collection = database.OpenCollection(database.Client, "teachers")
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct { ID primitive.ObjectID `bson:"_id"` FirstName string `json:"firstname" validate:"required"` LastName string `json:"lastname" validate:"required"` Email string `json:"email" validate:"required"` SchoolEmail string `json:"schoolemail"` Password string `json:"-" validate:"min=10,max=32"` TempPassword bool `json:"temppassword"` AID string `json:"aid"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
func (*Admin) CheckPasswordStrength ¶
func (*Admin) ComparePasswords ¶
func (*Admin) EmailExists ¶
func (*Admin) GeneratePassword ¶
func (*Admin) GenerateSchoolEmail ¶
func (*Admin) HashPassword ¶
type Contact ¶
type Contact struct { ID primitive.ObjectID `bson:"_id"` FirstName string `json:"firstname" validate:"required"` MiddleName string `json:"middlename"` LastName string `json:"lastname" validate:"required"` Province string `json:"province"` City string `json:"city"` Address string `json:"address" validate:"required"` Postal string `json:"postal"` HomePhone float64 `json:"homephone" validate:"required"` WorkPhone float64 `json:"workphone"` Email string `json:"email" validate:"required"` Relation string `json:"relation" validate:"required"` Priotrity float64 `json:"priority" validate:"required"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
type Course ¶
type Course struct { ID primitive.ObjectID `bson:"_id"` Name string `json:"name" validate:"required"` Code string `json:"code" validate:"required"` // Short string to identify each class GradeLevel int `json:"gradelevel" validate:"required"` Credits int `json:"credits" default:"4"` TotalRequest int `json:"totalRequest" default:"0"` // Amount of requests for this course Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
type Student ¶
type Student struct { ID primitive.ObjectID `bson:"_id"` Personal struct { FirstName string `json:"firstname" validate:"required"` MiddleName string `json:"middlename"` LastName string `json:"lastname" validate:"required"` Age float64 `json:"age" validate:"required"` Email string `json:"email" validate:"required"` Address string `json:"address"` City string `json:"city"` Province string `json:"province"` Postal string `json:"postal"` DOB string `json:"dob" validate:"required"` Contacts []string `json:"contacts"` // List of contact ID's rather than contact object } `json:"personal"` School struct { GradeLevel float64 `json:"gradelevel" validate:"required"` SID string `json:"sid"` // Student ID PEN string `json:"ped"` // Personal Education Number Homeroom string `json:"homeroom"` Locker string `json:"-"` // Locker ID YOG int `json:"yog"` // Year of Graduation PhotoName string `json:"photoname"` // name of photo in db } `json:"School"` Account struct { VerifiedEmail bool `json:"verifiedemail"` SchoolEmail string `json:"schoolemail"` Password string `json:"-" validate:"min=10,max=32"` AccountDisabled bool `bson:"accountdisabled"` Alerted bool `bson:"alerted"` TempPassword bool `json:"temppassword"` Attempts int `json:"attempts"` // login attempts max 5 HashHistory []string `json:"-"` // List of old hashed passwords (not including auto generated passwords) } `json:"Account"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
func (*Student) CheckPasswordStrength ¶
func (*Student) ComparePasswords ¶
func (*Student) EmailExists ¶
func (*Student) GeneratePassword ¶
func (*Student) GenerateSchoolEmail ¶
func (*Student) HashPassword ¶
func (*Student) UsedPassword ¶
type Teacher ¶
type Teacher struct { ID primitive.ObjectID `bson:"_id"` Personal struct { FirstName string `json:"firstname" validate:"required"` MiddleName string `json:"middlename"` LastName string `json:"lastname" validate:"required"` Email string `json:"email" validate:"required"` Address string `json:"address"` City string `json:"city"` Province string `json:"province"` Postal string `json:"postal"` DOB string `json:"dob" validate:"required"` } `json:"personal"` School struct { TID string `json:"tid"` // Teacher ID Homeroom string `json:"homeroom"` PhotoName string `json:"photoname"` // name of photo in db } `json:"School"` Account struct { VerifiedEmail bool `json:"verifiedemail"` SchoolEmail string `json:"schoolemail"` Password string `json:"-" validate:"min=10,max=32"` AccountDisabled bool `bson:"accountdisabled"` TempPassword bool `json:"temppassword"` Attempts int `json:"attempts"` // login attempts max 5 HashHistory []string `json:"-"` // List of old hashed passwords (not including auto generated passwords) } `json:"Account"` Created_at time.Time `json:"created_at"` Updated_at time.Time `json:"updated_at"` }
func (*Teacher) CheckPasswordStrength ¶
func (*Teacher) ComparePasswords ¶
func (*Teacher) EmailExists ¶
func (*Teacher) GeneratePassword ¶
func (*Teacher) GenerateSchoolEmail ¶
func (*Teacher) HashPassword ¶
func (*Teacher) UsedPassword ¶
Click to show internal directories.
Click to hide internal directories.