Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Announcement ¶
Announcement contains the message to broadcast and the date that it expires
type AuthToken ¶
type AuthToken struct { TokenType string `json:"token_type"` Token string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` }
AuthToken Bearer auth token
type AuthTokenClaim ¶
type AuthTokenClaim struct { *jwt.StandardClaims Username string }
AuthTokenClaim a auth token claim from a user
type Break ¶
type Break struct { Winter StartEnd `yaml:"winter"` Sprint StartEnd `yaml:"sprint"` Various []*string `yaml:"various"` }
Break contains the periods of the breaks for semester breaks and national holidays
type Calendar ¶
type Calendar struct { Semesters Semester `yaml:"semesters"` Exams Exam `yaml:"exams"` Breaks Break `yaml:"breaks"` }
Calendar contains semesters, exams and breaks in an academic year
func LoadCalendar ¶
LoadCalendar reads a yaml file and returns calendar struct
type Configuration ¶
type Configuration struct { ExamsLink string `yaml:"exams"` Hostname string `yaml:"hostname"` Secret string `yaml:"secret"` Port int `yaml:"port"` RedisConfig Redis `yaml:"redis"` }
Configuration contains all the configuration parameters.
func LoadConfiguration ¶
func LoadConfiguration(file string) (*Configuration, error)
LoadConfiguration reads a configuration file and returns a struct.
type Context ¶
type DBScheduleSlot ¶
type DBScheduleSlot struct { gorm.Model `json:"db_info"` ScheduleSlot }
type ErrorMsg ¶
type ErrorMsg struct {
Message string `json:"message"`
}
ErrorMsg has an error message
type Exam ¶
type Exam struct { September StartEnd `yaml:"september"` Winter StartEnd `yaml:"winter"` Sprint StartEnd `yaml:"sprint"` }
Exam there are 3 exam periods, winter, sprint and September
type Holiday ¶
type Holiday struct { Date string `json:"date"` Name string `json:"localName"` IntName string `json:"name"` }
Holiday struct that defines a holiday
type Info ¶
type Info struct { IsWeekend bool `json:"weekend"` IsBreak bool `json:"break"` IsExamsPeriod bool `json:"exams"` IsNormalPeriod bool `json:"normal"` }
Info contains the booleans to determine the current state of the university
type Reader ¶
type Reader struct { Announcement *Announcement `yaml:"announcement"` RoomAnnouncements map[string]*Announcement `yaml:"room_announcements"` Comment *Announcement `yaml:"comment"` }
Reader struct that contains all announcements from existing.yml
type Schedule ¶
type Schedule struct {
Slots []*ScheduleSlot `json:"slots"`
}
Schedule The schedule object containing all the schedule slots.
type ScheduleNow ¶
type ScheduleNow struct { Now *ScheduleSlot `json:"now"` Next []*ScheduleSlot `json:"next"` }
type ScheduleSlot ¶
type ScheduleSlot struct { //ID int `gorm:"AUTO_INCREMENT;primary_key;not_null;unique_index"` Room string `json:"room" gorm:"text;not_null"` // Day is the days after the start of the week (0 = Sunday) Day int `json:"day" gorm:"-"` // Start is seconds after the start of day. Start int64 `json:"start" gorm:"numeric;not_null"` // End is seconds after the start of day. End int64 `json:"end" gorm:"numeric;not_null"` Title string `json:"title" gorm:"text;not_null"` Host string `json:"host" gorm:"text;not_null"` Semester string `json:"semester" gorm:"-"` DayNum int `json:"-" gorm:"-"` MonthNum int `json:"-" gorm:"-"` IsExam bool `json:"isExam" gorm:"boolean;not_null"` }
ScheduleSlot Contains information about a schedule slot, like times, room and subject.