factory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Absence

type Absence struct {
	AbsenceReports []AbsenceReport `json:"AbsenceReport"`
}

Absence is the incoming absence representation

type AbsenceReport

type AbsenceReport struct {
	CourseName   string `json:"Name"`
	AbsenceLevel string `json:"AbsenceLevel"`
}

AbsenceReport is the incoming absence report representation

type AbsenceReportAPI

type AbsenceReportAPI struct {
	CourseName string `json:"course"`
	Level      string `json:"level"`
}

AbsenceReportAPI is the outgoing absence report representation

func GetUserAbsenceReports

func GetUserAbsenceReports(username, password string) ([]AbsenceReportAPI, error)

GetUserAbsenceReports returns student's absence levels

func NewAbsenceReportAPI

func NewAbsenceReportAPI(absenceReport AbsenceReport) AbsenceReportAPI

NewAbsenceReportAPI is the AbsenceReportAPI constructor

type AuthorizedAPI

type AuthorizedAPI struct {
	IsAuthorized bool `json:"authorized"`
}

AuthorizedAPI is the outgoing authorized representation

func IsUserAuthorized

func IsUserAuthorized(username, password string) AuthorizedAPI

IsUserAuthorized returns validity of student's credentials

func NewAuthorizedAPI

func NewAuthorizedAPI(authorized string) AuthorizedAPI

NewAuthorizedAPI is the AuthorizedAPI constructor

type Course

type Course struct {
	ID   string `json:"sm_crs_id"`
	Name string `json:"course_short_name"`
}

Course is the incoming course representation

type Coursework

type Coursework struct {
	Courses  []Course  `json:"CurrentCourses"`
	Grades   []Grade   `json:"CourseWork"`
	Midterms []Midterm `json:"Midterm"`
}

Coursework is the incoming coursework representation

type CourseworkAPI

type CourseworkAPI struct {
	ID     string     `json:"-"`
	Code   string     `json:"-"`
	Name   string     `json:"course"`
	Grades []GradeAPI `json:"grades"`
}

CourseworkAPI is the outgoing coursework representation

func GetUserCoursework

func GetUserCoursework(username, password string) ([]CourseworkAPI, error)

GetUserCoursework returns student's coursework

func NewCourseworkAPI

func NewCourseworkAPI(course Course) CourseworkAPI

NewCourseworkAPI is the CourseworkAPI constructor

type Exam

type Exam struct {
	Course   string `json:"course_name"`
	DateTime string `json:"start_time"`
	Venue    string `json:"rsrc_code"`
	Seat     string `json:"seat_code"`
}

Exam is the incoming exam representation

type ExamAPI

type ExamAPI struct {
	Course   string    `json:"course"`
	DateTime time.Time `json:"dateTime"`
	Venue    string    `json:"venue"`
	Seat     string    `json:"seat"`
}

ExamAPI is the outgoing exam representation

func GetUserExams

func GetUserExams(username, password string) ([]ExamAPI, error)

GetUserExams return student's exams schedule

func NewExamAPI

func NewExamAPI(exam Exam) ExamAPI

NewExamAPI is the ExamAPI constructor

type Grade

type Grade struct {
	CourseID   string `json:"sm_crs_id"`
	ModuleName string `json:"eval_method_name"`
	Point      string `json:"grade"`
	MaxPoint   string `json:"max_point"`
}

Grade is the incoming grade representation

type GradeAPI

type GradeAPI struct {
	Module   string `json:"module"`
	Point    string `json:"point"`
	MaxPoint string `json:"maxPoint"`
}

GradeAPI is the outgoing grade representation

func NewGradeAPI

func NewGradeAPI(grade Grade) GradeAPI

NewGradeAPI is the GradeAPI constructor

type Midterm

type Midterm struct {
	CourseName string `json:"course_full_name"`
	Percentage string `json:"total_perc"`
}

Midterm is the incoming midterm representation

type MidtermAPI

type MidtermAPI struct {
	Name       string `json:"course"`
	Percentage string `json:"percentage"`
}

MidtermAPI is the outgoing midterm representation

func GetUserMidterms

func GetUserMidterms(username, password string) ([]MidtermAPI, error)

GetUserMidterms returns student's midterms grades

func NewMidtermAPI

func NewMidtermAPI(midterm Midterm) MidtermAPI

NewMidtermAPI is the MidtermAPI constructor

type ResponseAPI

type ResponseAPI struct {
	Error interface{} `json:"error"`
	Data  interface{} `json:"data"`
}

ResponseAPI is the generic outgoing response

type Schedule

type Schedule struct {
	Slot    string `json:"scd_col"`
	Course  string `json:"course"`
	Weekday string `json:"weekday"`
	Group   string `json:"group_name"`
}

Schedule is your schedule

type ScheduleAPI

type ScheduleAPI struct {
	Weekday string `json:"weekday"`
	Slot    int    `json:"slot"`
	Course  string `json:"course"`
	Group   string `json:"group"`
	Type    string `json:"type"`
}

ScheduleAPI is the outgoing schedule representation

func GetUserSchedule

func GetUserSchedule(username, password string) ([]ScheduleAPI, error)

GetUserSchedule return student's schedule

func NewScheduleAPI

func NewScheduleAPI(schedule Schedule) ScheduleAPI

NewScheduleAPI is the ScheduleApi constructor

type StudentAPI

type StudentAPI struct {
	Username        string             `json:"-"`
	Password        string             `json:"-"`
	Authorized      bool               `json:"authorized"`
	Coursework      []CourseworkAPI    `json:"coursework"`
	MidtermsGrades  []MidtermAPI       `json:"midtermsGrades"`
	AbsenceLevels   []AbsenceReportAPI `json:"absenceLevels"`
	ExamsSchedule   []ExamAPI          `json:"examsSchedule"`
	StudentSchedule []ScheduleAPI      `json:"studentSchedule"`
}

StudentAPI is the encapsulating representation of all student's data

type XMLResponseString

type XMLResponseString struct {
	Value string `xml:",chardata"`
}

XMLResponseString is the generic incoming response

Jump to

Keyboard shortcuts

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