Documentation
¶
Overview ¶
Package zpa is a minimal read-only client for HM's ZPA (Prüfungsamt) REST API, used to enrich a course roster with student details (name, group, gender). It is deliberately small — glabs only needs to look a student up — and keeps the HTTP details confined here, mirroring plexams.go's zpa package.
glabs identifies students by email, but ZPA's get_student_info search is primarily used with a Matrikelnummer in plexams. StudentByEmail therefore looks up defensively (by full email, then the email's local part) and returns nil when ZPA has no unambiguous match — so the students page degrades to just the email rather than showing wrong data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the ZPA REST API with a fixed token.
func New ¶
New builds a ZPA client. baseURL and token are required by the caller; an empty config means ZPA is disabled (bootstrap passes nil then).
func (*Client) StudentByEmail ¶
StudentByEmail looks a student up defensively: first by the full email, then by the email's local part. It returns (nil, nil) when ZPA has no unambiguous match, so callers can show just the email rather than guessing.