Documentation ¶
Index ¶
- Constants
- func Attendance(body io.Reader) (models.AttendanceRecords, error)
- func ClassSchedule(body io.Reader) (models.ClassSchedule, error)
- func CleanString(s string, set ...rune) string
- func Courses(body io.Reader) (models.Courses, error)
- func ExaminationResult(body io.Reader) (*models.ExamResultRecords, error)
- func ExaminationSchedule(body io.Reader) (*models.ExaminationSchedule, error)
- func FacultyFeedback(body io.Reader) (models.FacultyFeedbackSpecs, error)
- func IsLoggedIn(body io.Reader) bool
- func IsLoggedInDOM(doc *goquery.Document) bool
- func Profile(body io.Reader) (*models.Profile, error)
- func Semesters(body io.Reader) (models.SemesterList, error)
- func UnescapeUnicode(s string) string
- func VerificationToken(body io.Reader) string
- func VerificationTokenFromDom(dom *goquery.Document) string
- func WifiMacInfo(body io.Reader) (*models.WifiMacInfo, error)
Constants ¶
const ( ErrFailedToParse = "failed to parse" ErrFailedToParseDOM = ErrFailedToParse + " DOM" ErrNotLoggedIn = ErrFailedToParse + ": not logged in" )
Errors
const ExamTitleUnknown = "Unknown Exam"
Variables ¶
This section is empty.
Functions ¶
func Attendance ¶
func Attendance(body io.Reader) (models.AttendanceRecords, error)
Attendance attempts to parse course attendance information from the Amizone home page into a models.AttendanceRecords instance.
func ClassSchedule ¶
func ClassSchedule(body io.Reader) (models.ClassSchedule, error)
ClassSchedule attempts to parse the response of the Amizone diary events API endpoint into a models.ClassSchedule instance.
func CleanString ¶ added in v0.6.1
CleanString trims off whitespace and additional runes passed.
func ExaminationResult ¶ added in v0.8.0
func ExaminationResult(body io.Reader) (*models.ExamResultRecords, error)
ExaminationResult attempts to parse exam result information from the Amizone Examination Results page into a models.ExaminationResultRecords instance.
func ExaminationSchedule ¶
func ExaminationSchedule(body io.Reader) (*models.ExaminationSchedule, error)
ExaminationSchedule attempts to parse a page into a models.ExaminationSchedule model. This function expects the Amizone "Examination Schedule" page, parsable into an HTML document.
func FacultyFeedback ¶ added in v0.6.0
func FacultyFeedback(body io.Reader) (models.FacultyFeedbackSpecs, error)
func IsLoggedIn ¶ added in v0.2.0
IsLoggedIn attempts to determine whether a response body indicates an authenticated session. To achieve this, this function will first attempt to parse the body as an HTML document, failing to do which is assumed to indicate an authenticated session because Amizone seems to redirect unauthenticated requests from all endpoints to the login page. If the body is parsed into a HTMl document, this function will attempt to find the login form; failing to find the login form is assumed to indicate an authenticated session.
func IsLoggedInDOM ¶ added in v0.2.0
func Semesters ¶
func Semesters(body io.Reader) (models.SemesterList, error)
Semesters returns the number of ongoing or passed semesters from the Amizone courses page.
func UnescapeUnicode ¶ added in v0.4.0
UnescapeUnicode unescapes unicode characters in a string. Ref: https://groups.google.com/g/golang-nuts/c/KO1yubIbKpU/m/ue_EU8dcBQAJ
func VerificationToken ¶
func VerificationTokenFromDom ¶ added in v0.3.0
func WifiMacInfo ¶ added in v0.3.0
func WifiMacInfo(body io.Reader) (*models.WifiMacInfo, error)
Types ¶
This section is empty.