model

package
v3.42.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ActivityEntry added in v3.25.0

type ActivityEntry struct {
	// The course this entry is about (its name).
	Course string `json:"course"`
	// The assignment this entry is about (its name within the course).
	Assignment string `json:"assignment"`
	// The operation that ran (setaccess, protect, archive, delete, …).
	Op string `json:"op"`
	// The terminal outcome: `done` or `failed`.
	Status string `json:"status"`
	// A short human summary — the repository count on success, the error on failure.
	Detail string `json:"detail"`
	// When the operation finished.
	At time.Time `json:"at"`
}

One recorded operation performed through the web against an assignment — the web's stand-in for the shell history the CLI leaves behind. The course page reads it to show, per assignment, what has already happened (setaccess, protect, archive, delete; later generate).

type AssignmentReport added in v3.16.0

type AssignmentReport struct {
	Course     string `json:"course"`
	Assignment string `json:"assignment"`
	// The assignment-level group URL.
	URL         string `json:"url"`
	Description string `json:"description"`
	// When the report was generated.
	Generated *time.Time `json:"generated,omitempty"`
	// Whether the assignment configures a release merge request (adds that column).
	HasReleaseMergeRequest bool `json:"hasReleaseMergeRequest"`
	// Whether the assignment configures release docker images (adds that column).
	HasReleaseDockerImages bool `json:"hasReleaseDockerImages"`
	// One entry per repository in the assignment's group, sorted by name.
	Projects []*ProjectReport `json:"projects"`
}

A live report over the repositories of one assignment — one row per project (repo) with activity, last commit, open issues/merge requests, members and an optional release status. Fetched from GitLab using the caller's stored token.

type AssignmentRepos added in v3.35.0

type AssignmentRepos struct {
	Name string `json:"name"`
	// Whether repos are per student or per group.
	Per string `json:"per"`
	// How many repositories the assignment targets.
	Targets int `json:"targets"`
	// How many of them actually exist in GitLab.
	Existing int           `json:"existing"`
	Repos    []*RepoStatus `json:"repos"`
	Note     *string       `json:"note,omitempty"`
}

How many of an assignment's target repositories have been generated. `note` is set when the assignment could not be checked (abstract/unresolvable, or its GitLab group does not exist yet — i.e. nothing generated).

type AssignmentUrls added in v3.15.0

type AssignmentUrls struct {
	// Whether repos are per student or per group (`student` or `group`).
	Per string `json:"per"`
	// The assignment-level group URL, where all the repos live.
	GroupURL string `json:"groupUrl"`
	// One entry per student/group repository.
	Repos []*RepoURL `json:"repos"`
}

The repository URLs for one assignment: the assignment-level group URL plus one URL per student or per group. Read-only and derived purely from the resolved configuration — no GitLab token or API call is involved.

type AssignmentView added in v3.4.0

type AssignmentView struct {
	Course string `json:"course"`
	Name   string `json:"name"`
	// The assignment this one inherits from, if any (`extends`).
	Extends *string `json:"extends,omitempty"`
	// The names of the sibling assignments this one may inherit from — all assignments in the same course except this one (`extends` is course-internal). The valid choices for the editor's inheritance dropdown.
	ExtendsOptions []string `json:"extendsOptions"`
	// Whether this is an abstract base (a template for `extends`).
	Abstract bool `json:"abstract"`
	// The assignment's own (source) field values, keyed by FieldMeta.key, for pre-filling the editor form.
	Own []*FieldValue `json:"own"`
	// The resolved config rendered as text (may contain ANSI); empty when resolveError is set.
	Resolved string `json:"resolved"`
	// Why the assignment could not be resolved (e.g. abstract base, missing parent) — not an error.
	ResolveError *string `json:"resolveError,omitempty"`
}

One assignment in source (own) form plus its resolved preview — the same rendering `glabs show` produces, so inheritance is visible.

type CheckProgress added in v3.19.0

type CheckProgress struct {
	Message string       `json:"message"`
	Done    bool         `json:"done"`
	Result  *CheckResult `json:"result,omitempty"`
	Error   *string      `json:"error,omitempty"`
}

One event while a course check runs: a progress line as each entry is checked, or the single final event (done = true) carrying the result or an error.

type CheckResult added in v3.19.0

type CheckResult struct {
	Course string `json:"course"`
	// The course-level students, classified in configured order.
	Students []*StudentCheck `json:"students"`
	// The course's groups, each with its members classified.
	Groups []*GroupCheck `json:"groups"`
	// Students that appear in more than one group.
	Duplicates []*DuplicateCheck `json:"duplicates"`
	// Number of hard problems (unresolvable entries + duplicates).
	Errors int `json:"errors"`
	// Whether the whole course checks out (errors = 0).
	Ok bool `json:"ok"`
}

The result of checking a course's roster against GitLab: each roster entry classified, plus the students that appear in more than one group. Fetched with the caller's stored token.

type CommitReport added in v3.16.0

type CommitReport struct {
	Title         string     `json:"title"`
	CommitterName string     `json:"committerName"`
	CommittedDate *time.Time `json:"committedDate,omitempty"`
	WebURL        string     `json:"webUrl"`
}

The most recent commit across a repository's branches.

type Course added in v3.2.0

type Course struct {
	Name         string `json:"name"`
	CoursePath   string `json:"coursePath"`
	SemesterPath string `json:"semesterPath"`
	// Whether the course name is prepended to each project path.
	UseCoursenameAsPrefix bool `json:"useCoursenameAsPrefix"`
	// Whether the student's email domain is appended as a suffix (default true).
	UseEmailDomainAsSuffix bool `json:"useEmailDomainAsSuffix"`
	// The names of the assignments in this course, sorted.
	AssignmentNames []string `json:"assignmentNames"`
	// The course-level students (emails), as stored.
	Students []string `json:"students"`
	// The course-level groups, sorted by name.
	Groups       []*Group  `json:"groups"`
	StudentCount int       `json:"studentCount"`
	GroupCount   int       `json:"groupCount"`
	ImportedAt   time.Time `json:"importedAt"`
	UpdatedAt    time.Time `json:"updatedAt"`
}

A course as stored for the current user. Each user sees only their own courses; there is no way to reach another user's course.

type DockerImageReport added in v3.16.0

type DockerImageReport struct {
	Wanted string  `json:"wanted"`
	Image  *string `json:"image,omitempty"`
}

type DockerImagesReport added in v3.16.0

type DockerImagesReport struct {
	Status string               `json:"status"`
	Images []*DockerImageReport `json:"images"`
}

type DuplicateCheck added in v3.19.0

type DuplicateCheck struct {
	Student string   `json:"student"`
	Groups  []string `json:"groups"`
}

One student that appears in more than one group.

type Event added in v3.40.0

type Event struct {
	At time.Time `json:"at"`
	// login, login-rejected, job-scheduled, job-done, job-failed, job-expired, job-cancelled, op-done, op-failed, course-created, course-deleted, token-saved, token-deleted.
	Type string `json:"type"`
	// info | warning | error.
	Severity string `json:"severity"`
	// Acting user's email; empty for an anonymous rejected login.
	Actor     string `json:"actor"`
	ActorName string `json:"actorName"`
	// Faculty number (fhmDepartment), when the proxy forwards it.
	Department string `json:"department"`
	Course     string `json:"course"`
	Assignment string `json:"assignment"`
	Op         string `json:"op"`
	Detail     string `json:"detail"`
	JobID      string `json:"jobId"`
}

One thing that happened on the platform, worth an operator's attention: a login, a scheduled or finished job, an interactive operation, a course/token change. Most fields are optional and depend on the type.

type FieldKind added in v3.4.0

type FieldKind string

The input shape the GUI should render for a field.

const (
	FieldKindString     FieldKind = "STRING"
	FieldKindBool       FieldKind = "BOOL"
	FieldKindEnum       FieldKind = "ENUM"
	FieldKindInt        FieldKind = "INT"
	FieldKindStringlist FieldKind = "STRINGLIST"
)

func (FieldKind) IsValid added in v3.4.0

func (e FieldKind) IsValid() bool

func (FieldKind) MarshalGQL added in v3.4.0

func (e FieldKind) MarshalGQL(w io.Writer)

func (FieldKind) MarshalJSON added in v3.4.0

func (e FieldKind) MarshalJSON() ([]byte, error)

func (FieldKind) String added in v3.4.0

func (e FieldKind) String() string

func (*FieldKind) UnmarshalGQL added in v3.4.0

func (e *FieldKind) UnmarshalGQL(v any) error

func (*FieldKind) UnmarshalJSON added in v3.4.0

func (e *FieldKind) UnmarshalJSON(b []byte) error

type FieldMeta added in v3.4.0

type FieldMeta struct {
	// Config key, e.g. `per` or `accesslevel`.
	Key string `json:"key"`
	// Human-readable label for the form.
	Label string `json:"label"`
	// Short help text describing what the field does.
	Description string `json:"description"`
	// Section this field belongs to (empty for the top-level group), e.g. `startercode`. Lets the GUI render grouped sections.
	Group string `json:"group"`
	// The input shape the GUI should render.
	Kind FieldKind `json:"kind"`
	// Whether the field must be set for a concrete (non-abstract) assignment.
	Required bool `json:"required"`
	// Whether the field is deprecated (shown but discouraged).
	Deprecated bool `json:"deprecated"`
	// An example value for the input placeholder, if any.
	Example *string `json:"example,omitempty"`
	// Dropdown options for an ENUM field (empty otherwise).
	Options []*FieldOption `json:"options"`
}

The assignment editor is schema-driven: the GUI renders a guided, validated form from this server-authoritative metadata, so labels, help text and dropdown options live in exactly one place.

type FieldOption added in v3.4.0

type FieldOption struct {
	Value       string `json:"value"`
	Label       string `json:"label"`
	Description string `json:"description"`
}

One choice of an ENUM field — a dropdown entry with its own short description.

type FieldValue added in v3.5.0

type FieldValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

One field's own (source) value for an assignment — what the user wrote, before inheritance. Values are stringified (booleans as `true`/`false`) and keyed by the same `key` as FieldMeta, so the GUI can pre-fill each schema field generically.

type FieldValueInput added in v3.6.0

type FieldValueInput struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

One field's drafted value, keyed by FieldMeta.key. Booleans as `true`/`false`; empty string unsets the field (so it inherits).

type Finding added in v3.2.0

type Finding struct {
	Path     string          `json:"path"`
	Message  string          `json:"message"`
	Severity FindingSeverity `json:"severity"`
}

One lint finding: configuration that does not do what it looks like it does.

type FindingSeverity added in v3.2.0

type FindingSeverity string
const (
	// The setting is present but has no effect.
	FindingSeverityProblem FindingSeverity = "PROBLEM"
	// It works, but the spelling or shape is obsolete.
	FindingSeverityDeprecated FindingSeverity = "DEPRECATED"
)

func (FindingSeverity) IsValid added in v3.2.0

func (e FindingSeverity) IsValid() bool

func (FindingSeverity) MarshalGQL added in v3.2.0

func (e FindingSeverity) MarshalGQL(w io.Writer)

func (FindingSeverity) MarshalJSON added in v3.2.0

func (e FindingSeverity) MarshalJSON() ([]byte, error)

func (FindingSeverity) String added in v3.2.0

func (e FindingSeverity) String() string

func (*FindingSeverity) UnmarshalGQL added in v3.2.0

func (e *FindingSeverity) UnmarshalGQL(v any) error

func (*FindingSeverity) UnmarshalJSON added in v3.2.0

func (e *FindingSeverity) UnmarshalJSON(b []byte) error

type GitLabTokenStatus added in v3.3.0

type GitLabTokenStatus struct {
	Set       bool       `json:"set"`
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}

Whether the current user has stored a GitLab token, and when it was last set. The token itself is never returned by any query.

type Group added in v3.12.0

type Group struct {
	Name    string   `json:"name"`
	Members []string `json:"members"`
}

A named group of members (emails).

type GroupCheck added in v3.19.0

type GroupCheck struct {
	Name    string          `json:"name"`
	Members []*StudentCheck `json:"members"`
}

One group's members, classified.

type GroupInput added in v3.12.0

type GroupInput struct {
	Name    string   `json:"name"`
	Members []string `json:"members"`
}

A named group of members (emails), for setCourseGroups.

type JobParam added in v3.26.0

type JobParam struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

One key/value operation parameter of a scheduled job (e.g. accessLevel, branch).

type JobStatus added in v3.26.0

type JobStatus string

The lifecycle state of a scheduled job. It starts PENDING, is claimed to RUNNING, and ends in exactly one terminal state.

const (
	JobStatusPending   JobStatus = "PENDING"
	JobStatusRunning   JobStatus = "RUNNING"
	JobStatusDone      JobStatus = "DONE"
	JobStatusFailed    JobStatus = "FAILED"
	JobStatusExpired   JobStatus = "EXPIRED"
	JobStatusCancelled JobStatus = "CANCELLED"
)

func (JobStatus) IsValid added in v3.26.0

func (e JobStatus) IsValid() bool

func (JobStatus) MarshalGQL added in v3.26.0

func (e JobStatus) MarshalGQL(w io.Writer)

func (JobStatus) MarshalJSON added in v3.26.0

func (e JobStatus) MarshalJSON() ([]byte, error)

func (JobStatus) String added in v3.26.0

func (e JobStatus) String() string

func (*JobStatus) UnmarshalGQL added in v3.26.0

func (e *JobStatus) UnmarshalGQL(v any) error

func (*JobStatus) UnmarshalJSON added in v3.26.0

func (e *JobStatus) UnmarshalJSON(b []byte) error

type LogLevel added in v3.21.0

type LogLevel string

The severity/kind of one streamed output line.

const (
	LogLevelInfo     LogLevel = "INFO"
	LogLevelWarn     LogLevel = "WARN"
	LogLevelError    LogLevel = "ERROR"
	LogLevelProgress LogLevel = "PROGRESS"
	LogLevelResult   LogLevel = "RESULT"
	LogLevelDone     LogLevel = "DONE"
)

func (LogLevel) IsValid added in v3.21.0

func (e LogLevel) IsValid() bool

func (LogLevel) MarshalGQL added in v3.21.0

func (e LogLevel) MarshalGQL(w io.Writer)

func (LogLevel) MarshalJSON added in v3.21.0

func (e LogLevel) MarshalJSON() ([]byte, error)

func (LogLevel) String added in v3.21.0

func (e LogLevel) String() string

func (*LogLevel) UnmarshalGQL added in v3.21.0

func (e *LogLevel) UnmarshalGQL(v any) error

func (*LogLevel) UnmarshalJSON added in v3.21.0

func (e *LogLevel) UnmarshalJSON(b []byte) error

type LogLine added in v3.21.0

type LogLine struct {
	Level LogLevel `json:"level"`
	// The line text (ANSI stripped).
	Text string `json:"text"`
}

One line of a running operation's streamed output.

type Mutation added in v3.2.0

type Mutation struct {
}

type Op added in v3.20.0

type Op string

A mutating GitLab operation. None of them touch git — pure GitLab API calls.

const (
	OpSetaccess Op = "SETACCESS"
	OpProtect   Op = "PROTECT"
	OpArchive   Op = "ARCHIVE"
	OpDelete    Op = "DELETE"
	OpGenerate  Op = "GENERATE"
	OpUpdate    Op = "UPDATE"
)

func (Op) IsValid added in v3.20.0

func (e Op) IsValid() bool

func (Op) MarshalGQL added in v3.20.0

func (e Op) MarshalGQL(w io.Writer)

func (Op) MarshalJSON added in v3.20.0

func (e Op) MarshalJSON() ([]byte, error)

func (Op) String added in v3.20.0

func (e Op) String() string

func (*Op) UnmarshalGQL added in v3.20.0

func (e *Op) UnmarshalGQL(v any) error

func (*Op) UnmarshalJSON added in v3.20.0

func (e *Op) UnmarshalJSON(b []byte) error

type OpParams added in v3.20.0

type OpParams struct {
	// setaccess: the access level to grant (guest|reporter|developer|maintainer).
	AccessLevel *string `json:"accessLevel,omitempty"`
	// protect: the branch to protect.
	Branch *string `json:"branch,omitempty"`
	// archive: unarchive instead of archive.
	Unarchive *bool `json:"unarchive,omitempty"`
	// generate: create repos and push starter code but do NOT add/invite students or groups (for debugging).
	SkipInvite *bool `json:"skipInvite,omitempty"`
}

Optional parameters for an operation (op-specific; unset fields fall back to the assignment config).

type OpPlan added in v3.20.0

type OpPlan struct {
	Op         Op     `json:"op"`
	Course     string `json:"course"`
	Assignment string `json:"assignment"`
	// The resolved config, exactly as `glabs show` renders it (may contain ANSI).
	Resolved string           `json:"resolved"`
	Targets  []*PlannedTarget `json:"targets"`
	Warnings []string         `json:"warnings"`
	// Whether the operation is destructive (archive/delete) and needs the confirm phrase.
	Destructive bool `json:"destructive"`
	// For destructive ops: the phrase the user must type to confirm (the assignment path).
	ConfirmPhrase *string `json:"confirmPhrase,omitempty"`
	// Opaque, single-use confirm token to pass to runOp/scheduleOp.
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expiresAt"`
}

The preview of a mutating operation before it runs: the resolved config, the repositories it would touch, warnings, and an opaque confirm token (5 min TTL) that carries a hash of the resolved config — so runOp can reject a plan whose config changed underneath it.

type PlannedTarget added in v3.20.0

type PlannedTarget struct {
	// The student's email (or username/id) or the group's name.
	For string `json:"for"`
	// The repository's project name.
	Repo string `json:"repo"`
	// The full web URL of the repository.
	URL string `json:"url"`
}

One repository an operation would touch.

type PlatformSummary added in v3.40.0

type PlatformSummary struct {
	From           time.Time               `json:"from"`
	Until          time.Time               `json:"until"`
	TotalEvents    int                     `json:"totalEvents"`
	Quiet          bool                    `json:"quiet"`
	ActiveUsers    []*SummaryUser          `json:"activeUsers"`
	RejectedLogins []*SummaryRejectedLogin `json:"rejectedLogins"`
	ScheduledJobs  []*Event                `json:"scheduledJobs"`
	JobsRun        int                     `json:"jobsRun"`
	JobDone        int                     `json:"jobDone"`
	JobFailed      int                     `json:"jobFailed"`
	JobExpired     int                     `json:"jobExpired"`
	JobCancelled   int                     `json:"jobCancelled"`
	JobFailures    []*Event                `json:"jobFailures"`
	OpDone         int                     `json:"opDone"`
	OpFailed       int                     `json:"opFailed"`
	OpsByType      []*SummaryLabelCount    `json:"opsByType"`
	OpFailures     []*Event                `json:"opFailures"`
	CourseCreated  int                     `json:"courseCreated"`
	CourseDeleted  int                     `json:"courseDeleted"`
	TokenSaved     int                     `json:"tokenSaved"`
	TokenDeleted   int                     `json:"tokenDeleted"`
	Problems       []*Event                `json:"problems"`
}

The aggregated digest of a period's events — the same view the nightly mail sends, pre-digested into counts and short lists (never raw log lines).

type ProjectMemberReport added in v3.16.0

type ProjectMemberReport struct {
	Name     string `json:"name"`
	Username string `json:"username"`
	WebURL   string `json:"webUrl"`
}

A member of a repository (only the display fields, never GitLab-internal ids).

type ProjectReport added in v3.16.0

type ProjectReport struct {
	Name string `json:"name"`
	// Whether there was any activity beyond creation (or any commits).
	Active                 bool                   `json:"active"`
	EmptyRepo              bool                   `json:"emptyRepo"`
	Commits                int                    `json:"commits"`
	CreatedAt              *time.Time             `json:"createdAt,omitempty"`
	LastActivity           *time.Time             `json:"lastActivity,omitempty"`
	LastCommit             *CommitReport          `json:"lastCommit,omitempty"`
	OpenIssuesCount        int                    `json:"openIssuesCount"`
	OpenMergeRequestsCount int                    `json:"openMergeRequestsCount"`
	WebURL                 string                 `json:"webUrl"`
	Members                []*ProjectMemberReport `json:"members"`
	Release                *ReleaseReport         `json:"release,omitempty"`
}

The report for one repository.

type Query

type Query struct {
}

type ReleaseMergeRequestReport added in v3.16.0

type ReleaseMergeRequestReport struct {
	Found          bool   `json:"found"`
	WebURL         string `json:"webUrl"`
	PipelineStatus string `json:"pipelineStatus"`
}

type ReleaseReport added in v3.16.0

type ReleaseReport struct {
	MergeRequest *ReleaseMergeRequestReport `json:"mergeRequest,omitempty"`
	DockerImages *DockerImagesReport        `json:"dockerImages,omitempty"`
}

The release status of a repository, when the assignment configures a release.

type RepoOverviewEvent added in v3.36.0

type RepoOverviewEvent struct {
	// The assignment just checked (null on the final done event).
	Assignment *AssignmentRepos `json:"assignment,omitempty"`
	// Total number of assignments to check (for a progress count).
	Total int     `json:"total"`
	Done  bool    `json:"done"`
	Error *string `json:"error,omitempty"`
}

One streamed item of a course repo overview: a completed assignment as it is checked, then a final event with `done: true`. `error` is set (with done) when the overview cannot start — e.g. no stored GitLab token.

type RepoStatus added in v3.35.0

type RepoStatus struct {
	// The student's email (or username/id) or the group's name.
	For string `json:"for"`
	// The repository's project name.
	Repo string `json:"repo"`
	// The full web URL of the repository.
	URL string `json:"url"`
	// Whether the repository has been generated (exists in GitLab).
	Exists bool `json:"exists"`
}

One target repository of an assignment and whether it actually exists in GitLab.

type RepoURL added in v3.15.0

type RepoURL struct {
	// The student's email (or username/id fallback) or the group's name.
	For string `json:"for"`
	// The full web URL of the repository.
	URL string `json:"url"`
}

One repository URL together with who it belongs to.

type ReportProgress added in v3.18.0

type ReportProgress struct {
	// A human-readable progress line; empty on the final event.
	Message string `json:"message"`
	// True on the final event; then no more events follow.
	Done bool `json:"done"`
	// The finished report — set only on the final event, and only if it succeeded.
	Report *AssignmentReport `json:"report,omitempty"`
	// Why generation failed — set only on the final event on failure.
	Error *string `json:"error,omitempty"`
}

One event while a report is being generated: a progress line as it is fetched, or the single final event (done = true) carrying the finished report or an error.

type ScheduledJob added in v3.26.0

type ScheduledJob struct {
	ID string `json:"id"`
	// The operation (setaccess, protect, archive, delete).
	Op         string `json:"op"`
	Course     string `json:"course"`
	Assignment string `json:"assignment"`
	// The subset of students/groups the op targets (empty = all).
	OnlyFor []string `json:"onlyFor"`
	// Op-specific parameters (e.g. accessLevel), sorted by key.
	Params []*JobParam `json:"params"`
	// When the job is scheduled to run.
	RunAt time.Time `json:"runAt"`
	// How long after runAt the job may still start before it is marked EXPIRED.
	GraceMinutes int        `json:"graceMinutes"`
	Status       JobStatus  `json:"status"`
	CreatedAt    time.Time  `json:"createdAt"`
	StartedAt    *time.Time `json:"startedAt,omitempty"`
	FinishedAt   *time.Time `json:"finishedAt,omitempty"`
	// The error message when the job FAILED or EXPIRED.
	Err *string `json:"err,omitempty"`
}

A mutating operation queued to run at a wall-clock time. It is persisted in Mongo, so it survives restarts and a missed run is caught up after downtime; the runner re-checks the plan's config hash and a stored GitLab token when it fires, and emails the outcome.

type ServerInfo

type ServerInfo struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	Date    string `json:"date"`
}

Version and build metadata for the running server.

type StudentCheck added in v3.19.0

type StudentCheck struct {
	// The raw roster entry, as written.
	Input  string             `json:"input"`
	Status StudentCheckStatus `json:"status"`
	// Human-readable detail (the resolved user, or why it failed).
	Message string `json:"message"`
}

One roster entry classified against GitLab.

type StudentCheckStatus added in v3.19.0

type StudentCheckStatus string

How a roster entry resolved against GitLab.

const (
	// Resolved (pinned by ID, or matched uniquely by email).
	StudentCheckStatusOk StudentCheckStatus = "OK"
	// No GitLab user yet, but there is an email → will be invited.
	StudentCheckStatusInvite StudentCheckStatus = "INVITE"
	// Resolved by username — works, but pinning by ID is safer.
	StudentCheckStatusDeprecated StudentCheckStatus = "DEPRECATED"
	// Cannot resolve and there is no email to fall back to.
	StudentCheckStatusError StudentCheckStatus = "ERROR"
)

func (StudentCheckStatus) IsValid added in v3.19.0

func (e StudentCheckStatus) IsValid() bool

func (StudentCheckStatus) MarshalGQL added in v3.19.0

func (e StudentCheckStatus) MarshalGQL(w io.Writer)

func (StudentCheckStatus) MarshalJSON added in v3.19.0

func (e StudentCheckStatus) MarshalJSON() ([]byte, error)

func (StudentCheckStatus) String added in v3.19.0

func (e StudentCheckStatus) String() string

func (*StudentCheckStatus) UnmarshalGQL added in v3.19.0

func (e *StudentCheckStatus) UnmarshalGQL(v any) error

func (*StudentCheckStatus) UnmarshalJSON added in v3.19.0

func (e *StudentCheckStatus) UnmarshalJSON(b []byte) error

type Subscription added in v3.18.0

type Subscription struct {
}

type SummaryLabelCount added in v3.40.0

type SummaryLabelCount struct {
	Label string `json:"label"`
	Count int    `json:"count"`
}

A labelled tally (interactive ops by kind).

type SummaryRejectedLogin added in v3.40.0

type SummaryRejectedLogin struct {
	Email      string `json:"email"`
	Department string `json:"department"`
	Count      int    `json:"count"`
}

One refused identity with its attempt count.

type SummaryUser added in v3.40.0

type SummaryUser struct {
	Email      string `json:"email"`
	Name       string `json:"name"`
	Department string `json:"department"`
	Logins     int    `json:"logins"`
}

One active user with how often they were seen in the period.

type User

type User struct {
	Email string `json:"email" bson:"email"`
	Name  string `json:"name" bson:"name"`
}

User is an authenticated user of glabs-web. Identity comes from the auth proxy (the OIDC email); there is no allowlist — anyone the proxy authenticates is let in.

glabs has no role hierarchy — every user manages only their own courses (strict per-user isolation), so there is nothing for roles to gate. The type is written by hand rather than generated so it carries bson tags (it was once persisted); gqlgen binds to it via autobind.

type ValidationResult added in v3.6.0

type ValidationResult struct {
	// Whether the draft is structurally sound and could be saved.
	Ok bool `json:"ok"`
	// Hard errors that make the draft unsaveable (empty when ok).
	Errors []string `json:"errors"`
	// The resolved config preview (Show() output, may contain ANSI) when the draft resolves.
	Resolved *string `json:"resolved,omitempty"`
	// Why there is no preview though the draft is ok — e.g. an abstract base.
	ResolveError *string `json:"resolveError,omitempty"`
}

Result of validating a draft assignment against the real resolver (the same one the CLI uses), without saving.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL