Documentation ¶
Index ¶
- type Store
- func (s *Store) AddJuryToDefenseSession(room, id, jury string) error
- func (s *Store) Convention(student string) (schema.Convention, error)
- func (s *Store) Defense(student string) (schema.Defense, error)
- func (s *Store) DefenseSession(room, id string) (schema.DefenseSession, error)
- func (s *Store) DefenseSessions() ([]schema.DefenseSession, error)
- func (s *Store) DelJuryToDefenseSession(room, id, jury string) error
- func (s *Store) Install() error
- func (s *Store) Internship(student string) (schema.Internship, error)
- func (s *Store) Internships() (schema.Internships, error)
- func (s *Store) NewDefenseSession(room string, id string) (schema.DefenseSession, error)
- func (s *Store) NewInternship(c schema.Convention) (schema.Internship, []byte, error)
- func (s *Store) NewPassword(token, newP []byte) (string, error)
- func (s *Store) NewSession(email string, password []byte, expire time.Duration) (schema.Session, error)
- func (s *Store) NewStudent(p schema.Person, major, promotion string, male bool) error
- func (s *Store) NewUser(p schema.Person, role schema.Role) ([]byte, error)
- func (s *Store) ReplaceUserWith(src, dst string) error
- func (s *Store) Report(k, email string) (schema.ReportHeader, error)
- func (s *Store) ReportContent(kind, email string) ([]byte, error)
- func (s *Store) Reports(email string) ([]schema.ReportHeader, error)
- func (s *Store) ResetPassword(email string) ([]byte, error)
- func (s *Store) ResetSurveyContent(student, kind string) error
- func (s *Store) RmDefenseSession(room, id string) error
- func (s *Store) RmSession(email string) error
- func (s *Store) RmStudentDefense(student string) error
- func (s *Store) RmUser(email string) error
- func (s *Store) Session(token []byte) (schema.Session, error)
- func (s *Store) SetAlumni(student string, a schema.Alumni) error
- func (s *Store) SetCompany(stu string, c schema.Company) error
- func (s *Store) SetDefenseGrade(student string, g int) error
- func (s *Store) SetEmail(old, now string) error
- func (s *Store) SetMajor(stu, m string) error
- func (s *Store) SetMale(stu string, m bool) error
- func (s *Store) SetPromotion(stu, p string) error
- func (s *Store) SetReportContent(kind, email string, cnt []byte) (time.Time, error)
- func (s *Store) SetReportDeadline(kind, email string, t time.Time) error
- func (s *Store) SetReportGrade(kind, email string, g int, comment string) (time.Time, error)
- func (s *Store) SetReportPrivacy(kind, email string, p bool) error
- func (s *Store) SetStudentDefense(session, room, student string, t time.Time, public, local bool) error
- func (s *Store) SetStudentSkippable(em string, st bool) error
- func (s *Store) SetSupervisor(stu string, t schema.Person) error
- func (s *Store) SetSurveyContent(token string, cnt interface{}) (time.Time, error)
- func (s *Store) SetSurveyInvitation(student, kind string) (time.Time, error)
- func (s *Store) SetTutor(stu string, t string) error
- func (s *Store) SetUserPerson(p schema.Person) error
- func (s *Store) SetUserRole(email string, priv schema.Role) error
- func (s *Store) Student(email string) (schema.Student, error)
- func (s *Store) Students() (schema.Students, error)
- func (s *Store) Survey(student, kind string) (schema.SurveyHeader, error)
- func (s *Store) SurveyFromToken(token string) (string, schema.SurveyHeader, error)
- func (s *Store) Surveys(student string) ([]schema.SurveyHeader, error)
- func (s *Store) UpdateStudentDefense(student string, t time.Time, public, local bool) error
- func (s *Store) User(email string) (schema.User, error)
- func (s *Store) Users() ([]schema.User, error)
- func (s *Store) Visit(u string) error
- type TxErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store allows to communicate with a database
func (*Store) AddJuryToDefenseSession ¶
func (*Store) Convention ¶
func (s *Store) Convention(student string) (schema.Convention, error)
Convention returns the convention of a given student
func (*Store) DefenseSession ¶
func (s *Store) DefenseSession(room, id string) (schema.DefenseSession, error)
func (*Store) DefenseSessions ¶
func (s *Store) DefenseSessions() ([]schema.DefenseSession, error)
DefenseSessions get all the defense sessions
func (*Store) DelJuryToDefenseSession ¶
func (*Store) Internship ¶
func (s *Store) Internship(student string) (schema.Internship, error)
Internship returns the internship for a given student
func (*Store) Internships ¶
func (s *Store) Internships() (schema.Internships, error)
Internships returns all the internships. Not necessarily validated
func (*Store) NewDefenseSession ¶
func (*Store) NewInternship ¶
func (s *Store) NewInternship(c schema.Convention) (schema.Internship, []byte, error)
NewInternship turns a convention into an internship. Returns the internship, the student token and an error
func (*Store) NewPassword ¶
NewPassword commits a password renewall request. From a request token and a new password, it returns upon success the target user email
func (*Store) NewSession ¶
func (s *Store) NewSession(email string, password []byte, expire time.Duration) (schema.Session, error)
NewSession creates a new session if the email and the password matches a user
func (*Store) NewStudent ¶
NewStudent create a new student using a given person, major, promotion and gender The major and the promotion must be valid against the supported values in config.Internships The underlying user account is created
func (*Store) ReplaceUserWith ¶
ReplaceUserWith the account referred by src by the account referred by dst
func (*Store) Report ¶
func (s *Store) Report(k, email string) (schema.ReportHeader, error)
Report returns the given report
func (*Store) ReportContent ¶
ReportContent returns the content of a given report
func (*Store) Reports ¶
func (s *Store) Reports(email string) ([]schema.ReportHeader, error)
Reports returns all the reports for a given student
func (*Store) ResetPassword ¶
ResetPassword starts a reset procedure
func (*Store) ResetSurveyContent ¶
ResetSurveyContent delete an uploaded survey
func (*Store) RmDefenseSession ¶
func (*Store) RmStudentDefense ¶
func (*Store) SetCompany ¶
SetCompany updates the student company
func (*Store) SetDefenseGrade ¶
SetDefenseGrade set the defense grade
func (*Store) SetPromotion ¶
SetPromotion updates the student promotion
func (*Store) SetReportContent ¶
SetReportContent saves the content of a given report if the report has not been already graded If the deadline passed, it is however possible to store the report once.
func (*Store) SetReportDeadline ¶
SetReportDeadline change a report deadline
func (*Store) SetReportGrade ¶
SetReportGrade stores the given report grade
func (*Store) SetReportPrivacy ¶
SetReportPrivacy changes the privacy level of a report
func (*Store) SetStudentDefense ¶
func (*Store) SetStudentSkippable ¶
SetStudentSkippable indicates if it is not required for the student to get an internship (an abandom typically)
func (*Store) SetSupervisor ¶
SetSupervisor updates the student supervisor
func (*Store) SetSurveyContent ¶
SetSurveyContent stores the survey answers
func (*Store) SetSurveyInvitation ¶
SetSurveyInvitation stores the invitation date for a survey to fullfil
func (*Store) SetUserPerson ¶
SetUserPerson changes the user profile if exists
func (*Store) SetUserRole ¶
SetUserRole updates the user privilege
func (*Store) Survey ¶
func (s *Store) Survey(student, kind string) (schema.SurveyHeader, error)
Survey returns the required survey
func (*Store) SurveyFromToken ¶
SurveyFromToken returns a given survey identifier
func (*Store) Surveys ¶
func (s *Store) Surveys(student string) ([]schema.SurveyHeader, error)
Surveys returns all the survey related to a student
func (*Store) UpdateStudentDefense ¶
type TxErr ¶
type TxErr struct {
// contains filtered or unexported fields
}
TxErr is a structure to manage transactions more confortablely. It maintains the ongoing error to state if the transaction must be committed or rollbacked
func (*TxErr) Done ¶
Done terminates the transaction. It is committed if err == nil. Rollbacked otherwise.