Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModuleRegistration ¶
type ModuleRegistration struct { ExamDate int // The selected exam date, 0 - first exam, 1 - second exam, or 2 - another semester // contains filtered or unexported fields }
ModuleRegistration represents a running registration for a module on the STiNE platform.
func CreateModuleRegistration ¶
func CreateModuleRegistration(registrationLink string) *ModuleRegistration
CreateModuleRegistration creates and returns a ModuleRegistration, which provides functions to register for the specified module and its corresponding events.
The registrationLink is the url the red "Register" button links to on the STiNE page.
func (*ModuleRegistration) Register ¶
func (modReg *ModuleRegistration) Register(client *http.Client, sessionNumber string) (*TanRequired, error)
Register sends the registration to the STiNE servers. If an iTAN is required, instead of nil a TanRequired is returned.
func (*ModuleRegistration) SetExamDate ¶
func (modReg *ModuleRegistration) SetExamDate(examDate int)
SetExamDate allows you to choose a specific exam date for the initial registration. If this function is not executed, the first exam date is selected by default.
The exam date will not be changed, if the user is already registered for the module.
0 - Selects the first exam date (default choice).
1 - Selects the second exam date.
2 - Opts for writing the exam in a different semester (exact date not specified).
type TanRequired ¶
type TanRequired struct { TanStartsWith string // The numbers the required iTAN starts with // contains filtered or unexported fields }
TanRequired is returned from a function, if an iTAN is needed to complete the action. TanStartsWith represents the two starting numbers of the required iTAN with a leading zero.
func (*TanRequired) SetTan ¶
func (tanReq *TanRequired) SetTan(itan string) error
SetTan sends the provided iTAN to the STiNE servers to complete an action. If the validation fails, an error is returned. The users iTAN list will be disabled after 3 failed attempts. The iTAN can be entered with the first three numbers or without the prefix provided by STiNE.