Documentation
¶
Index ¶
Constants ¶
const ( EventDateStart = "DTSTART" EventDescription = "DESCRIPTION" EventSummary = "SUMMARY" LayoutISO8601CompactZ = "20060102T150405Z0700" LayoutISO8601CompactNoTZ = "20060102T150405" LayoutISO8601Short = "20060102" )
const ( BaseURL = "https://ocjene.skole.hr" LoginURL = "https://ocjene.skole.hr/login" ClassURL = "https://ocjene.skole.hr/class" ClassActionURL = "https://ocjene.skole.hr/class_action/%v/course" GradeAllURL = "https://ocjene.skole.hr/grade/all" CalendarURL = "https://ocjene.skole.hr/exam/ical" CourseURL = "https://ocjene.skole.hr/course" )
const (
Timeout = 60 * time.Second // site can get really slow sometimes
)
Variables ¶
var ( ErrUnexpectedStatus = errors.New("unexpected status code") ErrCSRFToken = errors.New("could not find CSRF token") ErrNilBody = errors.New("client body is nil") ErrInvalidLogin = errors.New("unable to login") )
var ErrParseTimestamp = errors.New("failed to parse timestamp")
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client structure holds all HTTP Client related fields.
func NewClientWithContext ¶
NewClientWithContext creates new *Client, initializing HTTP Cookie Jar, context and username with password.
func (*Client) CloseConnections ¶ added in v0.9.0
func (c *Client) CloseConnections()
CloseConnections closes all connections on its transport.
func (*Client) GetClassEvents ¶ added in v0.9.0
GetClassEvents attempts to fetch all subjects and their grades, as well as all calendar events for exams in ICS format, returning raw grades listing body, parsed exam events and optional error.
func (*Client) GetClasses ¶ added in v0.9.0
GetClasses attempts to fetch all courses where a student has been previously enlisted or still is (multiple active classes possible).
func (*Client) GetCourse ¶ added in v0.21.0
GetCourse fetches the course with the given destination URL and returns its raw body, or an error.
func (*Client) GetCourses ¶ added in v0.21.0
GetCourses attempts to fetch all active courses.