Documentation
¶
Index ¶
- type ApiConfig
- type CachedApi
- func (api *CachedApi) Close() error
- func (api *CachedApi) GetCallSchedule() (api2.CallSchedule, error)
- func (api *CachedApi) GetCourses(facultyId int) ([]api2.Course, error)
- func (api *CachedApi) GetFaculties(structureId int) ([]api2.Faculty, error)
- func (api *CachedApi) GetGroupSchedule(groupId int, dateStart string, dateEnd string) (api2.Schedule, error)
- func (api *CachedApi) GetGroupScheduleDay(groupId int, date string) (*api2.TimeTableDate, error)
- func (api *CachedApi) GetGroupStudents(groupId int) ([]api2.Student, error)
- func (api *CachedApi) GetGroups(facultyId int, course int) ([]api2.Group, error)
- func (api *CachedApi) GetScheduleExtraInfo(classCode int, date string) (api2.ScheduleExtraInfo, error)
- func (api *CachedApi) GetStructures() ([]api2.Structure, error)
- type CachedDate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiConfig ¶
type ApiConfig struct { // LevelDBPath is a path to leveldb cache directory. Default is "api-cache/leveldb" LevelDBPath string // SQLiteDbPath is a path to sqlite3 cache file. Default is "api-cache/api.sqlite" SQLiteDbPath string // Expires is a cache expiration time. Default is 1 hour Expires time.Duration // Timeout is a request timeout. Default is 10 seconds Timeout time.Duration }
type CachedApi ¶
type CachedApi struct { Url string Expires time.Duration Timeout time.Duration // contains filtered or unexported fields }
func (*CachedApi) GetCallSchedule ¶
func (api *CachedApi) GetCallSchedule() (api2.CallSchedule, error)
GetCallSchedule returns a call schedule
func (*CachedApi) GetCourses ¶
GetCourses returns a list of courses in a faculty
func (*CachedApi) GetFaculties ¶
GetFaculties returns a list of faculties in a structure
func (*CachedApi) GetGroupSchedule ¶
func (api *CachedApi) GetGroupSchedule(groupId int, dateStart string, dateEnd string) (api2.Schedule, error)
GetGroupSchedule returns a schedule for a group from dateStart to dateEnd (inclusive)
func (*CachedApi) GetGroupScheduleDay ¶
GetGroupScheduleDay returns a schedule for a group for a day
Alias for GetGroupSchedule(groupId, date, date).GetDay(date)
func (*CachedApi) GetGroupStudents ¶
GetGroupStudents returns a list of students in a group
func (*CachedApi) GetScheduleExtraInfo ¶
func (api *CachedApi) GetScheduleExtraInfo(classCode int, date string) (api2.ScheduleExtraInfo, error)
GetScheduleExtraInfo returns a extra info for a schedule, that can be added by a teacher or university administration.
classCode is a "R1" field from TimeTablePeriod
Click to show internal directories.
Click to hide internal directories.