Documentation ¶
Overview ¶
Package degree provides a type to represent a degree course and related functions to fetch data from the unibo website.
Index ¶
- type Degree
- func (d *Degree) Exams() ([]exams.Exam, error)
- func (d *Degree) ExamsForSubject(subjectName string) ([]exams.Exam, error)
- func (d *Degree) GetAllCurricula() (map[int]curriculum.Curricula, error)
- func (d *Degree) GetCurricula(year int) (curriculum.Curricula, error)
- func (d *Degree) GetTimetable(year int, curriculum curriculum.Curriculum, period *timetable.Interval) (timetable.Timetable, error)
- func (d *Degree) ScrapeId() (ID, error)
- type ID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Degree ¶
type Degree struct { AcademicYear string // The academic year in which the course is taught Code int // The code of the course Description string // The description of the course Url string // The url of the course website Campus string // The campus where the course is taught International bool // Whether the course is taught in a language other than Italian InternationalTitle string // The title of the course, if International is true InternationalLanguage string // The language in which the course is taught, if International is true Fields string // The fields that the course covers Type string // The type of the course, e.g. "Laurea triennale" DurationInYears int // The duration of the course in years, e.g. 3 OpenForRegistration string // Whether the course is open for registration Languages string // The languages in which the course is taught AccessRequirements string // The access requirements TeachingLocation string // The main location where the course is taught // contains filtered or unexported fields }
Degree represents a degree course.
It can be obtained from UniBo's open data. See the opendata package for more information.
func (*Degree) ExamsForSubject ¶ added in v0.2.0
func (*Degree) GetAllCurricula ¶
func (d *Degree) GetAllCurricula() (map[int]curriculum.Curricula, error)
GetAllCurricula returns a map of all curricula of the degree. The keys are the years of the curricula.
Internally, it calls GetCurricula for each year in a separate goroutine, so it is faster than calling GetCurricula for each year.
func (*Degree) GetCurricula ¶
func (d *Degree) GetCurricula(year int) (curriculum.Curricula, error)
GetCurricula returns the curricula of the degree for the given year. The year must be between 1 and the duration of the degree.
func (*Degree) GetTimetable ¶
func (d *Degree) GetTimetable( year int, curriculum curriculum.Curriculum, period *timetable.Interval, ) (timetable.Timetable, error)
GetTimetable returns the timetable of the degree for the given year, curriculum and period.
Use GetCurricula or GetAllCurricula to get a curriculum. See timetable.FetchTimetable for more information.