Documentation ¶
Index ¶
- Variables
- func GetCurriculaUrl(course CourseId, year int) string
- func GetPackageUrl(id string) string
- func GetTimetableUrl(course CourseId, curriculum Curriculum, year int, period *TimetablePeriod) string
- type Aula
- type CalendarTime
- type Course
- type CourseId
- type Courses
- type CoursesMap
- type Curricula
- type Curriculum
- type Package
- type Resource
- type Resources
- type Timetable
- type TimetableEvent
- type TimetablePeriod
Constants ¶
This section is empty.
Variables ¶
View Source
var Client = http.Client{ Transport: &transport{ http.DefaultTransport, }, }
Client is the http client used to make requests. It is used to set a custom User-Agent.
Functions ¶
func GetCurriculaUrl ¶
func GetPackageUrl ¶
func GetTimetableUrl ¶
func GetTimetableUrl(course CourseId, curriculum Curriculum, year int, period *TimetablePeriod) string
GetTimetableUrl returns the URL to fetch the timetable for the given course.
If `curriculum` is not empty, it will be used to filter the timetable. If `period` is not nil, it will be used to filter the timetable.
Types ¶
type CalendarTime ¶
func (*CalendarTime) MarshalJSON ¶
func (c *CalendarTime) MarshalJSON() ([]byte, error)
func (*CalendarTime) UnmarshalJSON ¶
func (c *CalendarTime) UnmarshalJSON(b []byte) error
type Course ¶
type Course struct { AnnoAccademico string Immatricolabile string Codice int Descrizione string Url string Campus string Ambiti string Tipologia string DurataAnni int Internazionale bool InternazionaleTitolo string InternazionaleLingua string Lingue string Accesso string SedeDidattica string }
func (Course) GetCourseWebsiteId ¶
GetCourseWebsiteId returns the [CourseWebsiteId] of the course.
If the course website id is already set, it returns it, otherwise it scrapes it from the course website.
func (Course) GetTimetable ¶
func (c Course) GetTimetable(year int, curriculum Curriculum, period *TimetablePeriod) (Timetable, error)
type CoursesMap ¶
func (CoursesMap) ToList ¶
func (c CoursesMap) ToList() Courses
type Curricula ¶
type Curricula []Curriculum
type Curriculum ¶
type Package ¶
func GetPackage ¶
type Resource ¶
type Timetable ¶
type Timetable []TimetableEvent
func FetchTimetable ¶
func FetchTimetable( course CourseId, curriculum Curriculum, year int, period *TimetablePeriod, ) (timetable Timetable, err error)
type TimetableEvent ¶
type TimetableEvent struct { CodModulo string `json:"cod_modulo"` PeriodoCalendario string `json:"periodo_calendario"` CodSdoppiamento string `json:"cod_sdoppiamento"` Title string `json:"title"` ExtCode string `json:"extCode"` Periodo string `json:"periodo"` Docente string `json:"docente"` Cfu int `json:"cfu"` Teledidattica bool `json:"teledidattica"` Teams string `json:"teams,omitempty"` Start CalendarTime `json:"start"` End CalendarTime `json:"end"` Aule []Aula `json:"aule"` }
Click to show internal directories.
Click to hide internal directories.