Documentation ¶
Index ¶
- Constants
- func GenerateRandomString(n int) string
- type AbsentStatus
- type Calificativ
- type Class
- type DatabaseHandler
- func (db *DatabaseHandler) AddCalificativ(profEmail string, calificativ *Calificativ) error
- func (db *DatabaseHandler) CreateClass(class *Class) ([]*authentication.Student, error)
- func (db *DatabaseHandler) CreateExam(a *Exam) error
- func (db *DatabaseHandler) CreateProfesor(profesor *authentication.Profesor) error
- func (db *DatabaseHandler) CreateStudent(student *authentication.Student) error
- func (db *DatabaseHandler) DeleteStudent(u *uint) error
- func (db *DatabaseHandler) GetAllClasses(profEmail string) ([]string, error)
- func (db *DatabaseHandler) GetCalificativByStudentAndExercitiu(id uint, exercitiu uint) (*Calificativ, error)
- func (db *DatabaseHandler) GetCalificative(email string, student string) ([]*Calificativ, error)
- func (db *DatabaseHandler) GetClassByID(studentId uint) (*authentication.Clasa, error)
- func (db *DatabaseHandler) GetExamByName(name string) (*authentication.Exam, error)
- func (db *DatabaseHandler) GetExercitiiForProfesorAndStudent(email string, studentId string) ([]*Exercitiu, error)
- func (db *DatabaseHandler) GetExercitiuLimbaByExamAndNumber(exam string, number string) (*authentication.Exercitiu, error)
- func (db *DatabaseHandler) GetExercitiuStiintaByExamAndNumber(exam string, number string) (*authentication.Exercitiu, error)
- func (db *DatabaseHandler) GetProfesorByEmail(email string) (*authentication.Profesor, error)
- func (db *DatabaseHandler) GetStudentByID(id uint) (*authentication.Student, error)
- func (db *DatabaseHandler) GetStudentsByClass(clasa string) ([]authentication.Student, error)
- func (db *DatabaseHandler) IsAdmin(email string) (bool, error)
- func (db *DatabaseHandler) IsInterfaceNil() bool
- func (db *DatabaseHandler) IsProfesor(email string) (bool, error)
- func (db *DatabaseHandler) SetAbsent(status *AbsentStatus) error
- func (db *DatabaseHandler) UpdateCalificativ(profEmail string, calificativ *Calificativ) error
- type Exam
- type Exercitiu
Constants ¶
const WebServerOffString = "off"
WebServerOffString represents the constant used to switch off the web server
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomString ¶
Types ¶
type AbsentStatus ¶
type Calificativ ¶
type Class ¶
type Class struct { Nume string `json:"nume"` Elevi []struct { Nume string `json:"nume"` Prenume string `json:"prenume"` Email string `json:"email"` ExamStiinta string `json:"exam_stiinta"` ExamLimba string `json:"exam_limba"` } `json:"elevi"` ProfMate string `json:"prof_mate"` ProfFizica string `json:"prof_fizica"` ProfBio string `json:"prof_bio"` ProfRomana string `json:"prof_romana"` ProfEngleza string `json:"prof_engleza"` }
type DatabaseHandler ¶
type DatabaseHandler struct {
// contains filtered or unexported fields
}
func NewDatabaseHandler ¶
func NewDatabaseHandler(connectionstring string) (*DatabaseHandler, error)
NewDatabaseHandler returns a new DatabaseHandler instance
func (*DatabaseHandler) AddCalificativ ¶
func (db *DatabaseHandler) AddCalificativ(profEmail string, calificativ *Calificativ) error
func (*DatabaseHandler) CreateClass ¶
func (db *DatabaseHandler) CreateClass(class *Class) ([]*authentication.Student, error)
CreateClass creates a new class
func (*DatabaseHandler) CreateExam ¶
func (db *DatabaseHandler) CreateExam(a *Exam) error
func (*DatabaseHandler) CreateProfesor ¶
func (db *DatabaseHandler) CreateProfesor(profesor *authentication.Profesor) error
CreateProfesor creates a new profesor
func (*DatabaseHandler) CreateStudent ¶
func (db *DatabaseHandler) CreateStudent(student *authentication.Student) error
CreateStudent creates a new student
func (*DatabaseHandler) DeleteStudent ¶
func (db *DatabaseHandler) DeleteStudent(u *uint) error
func (*DatabaseHandler) GetAllClasses ¶
func (db *DatabaseHandler) GetAllClasses(profEmail string) ([]string, error)
GetAllClasses returns all the users from a class
func (*DatabaseHandler) GetCalificativByStudentAndExercitiu ¶
func (db *DatabaseHandler) GetCalificativByStudentAndExercitiu(id uint, exercitiu uint) (*Calificativ, error)
func (*DatabaseHandler) GetCalificative ¶
func (db *DatabaseHandler) GetCalificative(email string, student string) ([]*Calificativ, error)
func (*DatabaseHandler) GetClassByID ¶
func (db *DatabaseHandler) GetClassByID(studentId uint) (*authentication.Clasa, error)
func (*DatabaseHandler) GetExamByName ¶
func (db *DatabaseHandler) GetExamByName(name string) (*authentication.Exam, error)
GetExamByName returns a student by name
func (*DatabaseHandler) GetExercitiiForProfesorAndStudent ¶
func (db *DatabaseHandler) GetExercitiiForProfesorAndStudent(email string, studentId string) ([]*Exercitiu, error)
func (*DatabaseHandler) GetExercitiuLimbaByExamAndNumber ¶
func (db *DatabaseHandler) GetExercitiuLimbaByExamAndNumber(exam string, number string) (*authentication.Exercitiu, error)
GetExercitiuByName returns a student by name
func (*DatabaseHandler) GetExercitiuStiintaByExamAndNumber ¶
func (db *DatabaseHandler) GetExercitiuStiintaByExamAndNumber(exam string, number string) (*authentication.Exercitiu, error)
GetExercitiuByName returns a student by name
func (*DatabaseHandler) GetProfesorByEmail ¶
func (db *DatabaseHandler) GetProfesorByEmail(email string) (*authentication.Profesor, error)
GetProfesorByEmail returns a profesor by email
func (*DatabaseHandler) GetStudentByID ¶
func (db *DatabaseHandler) GetStudentByID(id uint) (*authentication.Student, error)
GetStudentByID returns a student by id
func (*DatabaseHandler) GetStudentsByClass ¶
func (db *DatabaseHandler) GetStudentsByClass(clasa string) ([]authentication.Student, error)
GetStudentsByClass returns all the users from a class
func (*DatabaseHandler) IsAdmin ¶
func (db *DatabaseHandler) IsAdmin(email string) (bool, error)
IsAdmin returns true if the user is an admin
func (*DatabaseHandler) IsInterfaceNil ¶
func (db *DatabaseHandler) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*DatabaseHandler) IsProfesor ¶
func (db *DatabaseHandler) IsProfesor(email string) (bool, error)
IsProfesor returns true if the user is a profesor
func (*DatabaseHandler) SetAbsent ¶
func (db *DatabaseHandler) SetAbsent(status *AbsentStatus) error
SetAbsent sets a student as absent
func (*DatabaseHandler) UpdateCalificativ ¶
func (db *DatabaseHandler) UpdateCalificativ(profEmail string, calificativ *Calificativ) error