Documentation
¶
Index ¶
- Constants
- type AmizoneDiaryEvent
- type AmizoneDiaryEvents
- type Attendance
- type AttendanceRecord
- type AttendanceRecords
- type AttendanceState
- type ClassSchedule
- type Course
- type CourseRef
- type CourseResult
- type Courses
- type Credits
- type ExamResultRecord
- type ExamResultRecords
- type ExaminationSchedule
- type FacultyFeedbackSpec
- type FacultyFeedbackSpecs
- type Marks
- type OverallResult
- type Profile
- type ScheduledClass
- type ScheduledExam
- type Score
- type Semester
- type SemesterList
- type WifiMacInfo
Constants ¶
const ( ColorAttendanceAbsent = "#F00" ColorAttendancePending = "#3A87AD" // TODO: add "not yet marked" state (orange) ColorAttendancePresent = "#4FCC4F" ColorAttendanceNA = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmizoneDiaryEvent ¶
type AmizoneDiaryEvent struct { Type string `json:"sType"` // "C" for course, "E" for event, "H" for holiday CourseName string `json:"title"` CourseCode string `json:"CourseCode"` Faculty string `json:"FacultyName"` Room string `json:"RoomNo"` Start string `json:"start"` // Start and end keys are in the format "YYYY-MM-DD HH:MM:SS" End string `json:"end"` AttendanceColor string `json:"AttndColor"` }
AmizoneDiaryEvent is the JSON format we expect from the Amizone diary events endpoint.
func (*AmizoneDiaryEvent) AttendanceState ¶
func (e *AmizoneDiaryEvent) AttendanceState() AttendanceState
type AmizoneDiaryEvents ¶
type AmizoneDiaryEvents []AmizoneDiaryEvent
type Attendance ¶
type AttendanceRecord ¶
type AttendanceRecord struct { Attendance Course CourseRef }
AttendanceRecord is a model for representing attendance record for a single course from the portal.
type AttendanceRecords ¶
type AttendanceRecords []AttendanceRecord
AttendanceRecords is a model for representing attendance from the portal.
type AttendanceState ¶
type AttendanceState int
const ( AttendanceStatePending AttendanceState = iota AttendanceStatePresent AttendanceStateAbsent AttendanceStateNA AttendanceStateInvalid )
type ClassSchedule ¶
type ClassSchedule []ScheduledClass
ClassSchedule is a model for representing class schedule from the portal.
func (*ClassSchedule) FilterByDate ¶
func (s *ClassSchedule) FilterByDate(t time.Time) ClassSchedule
func (*ClassSchedule) Sort ¶
func (s *ClassSchedule) Sort()
Sort sorts the ClassSchedule by ScheduledClass.StartTime
type Course ¶
type Course struct { CourseRef Type string Attendance Attendance InternalMarks Marks // 0, 0 if not available SyllabusDoc string // This is, really, a link. Most often broken and useless. }
Courses is a model for representing a list of courses from the portal. This model should most often be used to hold all courses for a certain semester.
type CourseRef ¶
CourseRef is a model for representing a minimal reference to a course, usually embedded in other models.
type CourseResult ¶
CourseResult is a model to represent the course wise result in the examinations result page
type ExamResultRecord ¶
type ExamResultRecord struct { Course CourseRef CourseResult }
type ExamResultRecords ¶
type ExamResultRecords struct { CourseWise []ExamResultRecord Overall []OverallResult }
ExamResultRecords includes the result for every course in an array and the overall result of every semester up to that point
type ExaminationSchedule ¶
type ExaminationSchedule struct { Title string Exams []ScheduledExam }
ExaminationSchedule is a model for representing exam schedule from the portal.
type FacultyFeedbackSpec ¶
type FacultyFeedbackSpecs ¶
type FacultyFeedbackSpecs []FacultyFeedbackSpec
type OverallResult ¶
type OverallResult struct { Semester Semester SemesterGradePointAverage float32 CumulativeGradePointAverage float32 }
OverallResult is a model to represent the semester result, with the GPA etc in the examination result page
type Profile ¶
type Profile struct { Name string EnrollmentNumber string EnrollmentValidity time.Time Batch string Program string DateOfBirth time.Time BloodGroup string IDCardNumber string UUID string }
Profile is a model for representing a user's Amizone profile.
type ScheduledClass ¶
type ScheduledClass struct { Course CourseRef StartTime time.Time EndTime time.Time Faculty string Room string Attended AttendanceState }
ScheduledClass models the data extracted from the class schedule as found on the Amizone home page.
type ScheduledExam ¶
type Semester ¶
Semester models a semester reference on Amizone. We include both a semester "name" / label and a ref to decouple the way they're represented from their form values. These happen to be same at the time of modelling, however, so they might appear duplicitous.
type SemesterList ¶
type SemesterList []Semester
SemesterList is a model for representing semesters. Often, this model will be used for ongoing and past semesters for which information can be retrieved.
type WifiMacInfo ¶
type WifiMacInfo struct { RegisteredAddresses []net.HardwareAddr Slots int FreeSlots int // contains filtered or unexported fields }
func (*WifiMacInfo) GetRequestVerificationToken ¶
func (i *WifiMacInfo) GetRequestVerificationToken() string
func (*WifiMacInfo) HasFreeSlot ¶
func (i *WifiMacInfo) HasFreeSlot() bool
func (*WifiMacInfo) IsRegistered ¶
func (i *WifiMacInfo) IsRegistered(mac net.HardwareAddr) bool
func (*WifiMacInfo) SetRequestVerificationToken ¶
func (i *WifiMacInfo) SetRequestVerificationToken(token string)