Documentation ¶
Index ¶
- Constants
- type Account
- func (acc *Account) DoFormRequest(data url.Values) (*http.Response, error)
- func (acc *Account) DoRequest(req *http.Request) (*http.Response, error)
- func (acc *Account) ExamResults(semesterID string) ([][]string, error)
- func (acc *Account) Exams(semesterID string) ([][]string, error)
- func (acc *Account) Login(user, pass string) error
- func (acc *Account) Scheduler(date, skip, view string) ([]Schedule, error)
- func (acc *Account) SchedulerExport(date string) (string, error)
- func (acc *Account) Session() (string, string)
- func (acc *Account) SessionValid() error
- func (acc *Account) SetClient(client *http.Client)
- func (acc *Account) SetSession(id, cnsc string)
- func (acc *Account) SetTimeout(timeout time.Duration)
- func (acc *Account) SetTransport(trans *http.Transport)
- type Schedule
Constants ¶
const ScheduleDay = "0"
ScheduleDay means: show day view
const ScheduleWeek = "1"
ScheduleWeek means: show week view
const SkipNext = "N"
SkipNext means: skip to next day/week
const SkipNone = ""
SkipNone means: do not skip (default)
const SkipPrev = "P"
SkipPrev means: skip to previous day/week
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account represents a STiNE account.
func (*Account) DoFormRequest ¶
DoFormRequest performs an HTTP POST request with form data.
func (*Account) ExamResults ¶
ExamResults returns an array of exam results, each with: ID, Name, Date, Grade, Grade text. semesterID can be empty (for the current semester), or and ID such as "099999904632582" (SoSe20), "999" (all)
func (*Account) Exams ¶
Exams returns an array of exams, each with: ID, Name, Type, Date. semesterID can be empty (for the current semester), or and ID such as "099999904632582" (SoSe20), "999" (all)
func (*Account) Scheduler ¶
Scheduler returns an array of schedules. If given, date must be formatted as: DD.MM.YYYY; default is current date. Skip can be emtpy, "N" (next) or "P" (previous). View can be "0" (day) or "1" (week).
func (*Account) SchedulerExport ¶
SchedulerExport exports the schedule of a given month or week as an .ics file. Date examples: "Y2020M06" (month), "Y2020W25" (week). Dates must be in the present or future.
func (*Account) SessionValid ¶
SessionValid checks if the current session is valid.
func (*Account) SetSession ¶
SetSession allows you to reuse a session ID and cookie.
func (*Account) SetTimeout ¶
SetTimeout sets the time limit for requests.
func (*Account) SetTransport ¶
SetTransport configures the transport options of the http client.