models

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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 added in v0.4.0

func (e *AmizoneDiaryEvent) AttendanceState() AttendanceState

type AmizoneDiaryEvents

type AmizoneDiaryEvents []AmizoneDiaryEvent

type Attendance

type Attendance struct {
	ClassesHeld     int32
	ClassesAttended int32
}

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 added in v0.4.0

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

type CourseRef struct {
	Code string
	Name string
}

CourseRef is a model for representing a minimal reference to a course, usually embedded in other models.

type CourseResult added in v0.8.0

type CourseResult struct {
	Score       Score
	Credits     Credits
	PublishDate time.Time
}

CourseResult is a model to represent the course wise result in the examinations result page

type Courses

type Courses []Course

type Credits added in v0.8.0

type Credits struct {
	Acquired  int
	Effective int
	Points    int
}

type ExamResultRecord added in v0.8.0

type ExamResultRecord struct {
	Course CourseRef
	CourseResult
}

type ExamResultRecords added in v0.8.0

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 added in v0.6.0

type FacultyFeedbackSpec struct {
	VerificationToken string

	CourseType   string
	DepartmentId string
	FacultyId    string
	SerialNumber string

	Set__Rating  string
	Set__QRating string
	Set__Comment string
}

type FacultyFeedbackSpecs added in v0.6.0

type FacultyFeedbackSpecs []FacultyFeedbackSpec

type Marks

type Marks struct {
	Have float32
	Max  float32
}

Marks is a model for representing marks (have/max).

func (Marks) Available

func (m Marks) Available() bool

Available indicates if marks were available

type OverallResult added in v0.8.0

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 ScheduledExam struct {
	Course   CourseRef
	Time     time.Time
	Mode     string
	Location string
}

type Score added in v0.8.0

type Score struct {
	Max        int
	Grade      string
	GradePoint int
}

type Semester

type Semester struct {
	Name string
	Ref  string
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL