db

package
v1.95.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: BSD-3-Clause Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionName

type CollectionName string

type Conflict

type Conflict struct {
	AnCode     int
	Module     string
	MainExamer string
	Conflicts  map[int]int
}

type ConnectedExam

type ConnectedExam struct {
	ZpaExam           int            `bson:"zpaExamAncode"`
	PrimussExams      []*PrimussExam `bson:"primussExamsAncodes"`
	OtherPrimussExams []*PrimussExam `bson:"otherPrimussExamsAncodes"`
	Errors            []string       `bson:"errors"`
}

type Count

type Count struct {
	AnCode int `bson:"AnCo"`
	Sum    int `bson:"Sum"`
}

type DB

type DB struct {
	Client *mongo.Client
	// contains filtered or unexported fields
}

func NewDB

func NewDB(uri, semester string, dbName *string) (*DB, error)

func (*DB) AddAncode

func (db *DB) AddAncode(ctx context.Context, zpaAncode int, program string, primussAncode int) error

func (*DB) AddConstraints added in v1.20.0

func (db *DB) AddConstraints(ctx context.Context, ancode int, constraints *model.Constraints) (*model.Constraints, error)

func (*DB) AddExamToSlot

func (db *DB) AddExamToSlot(ctx context.Context, planEntry *model.PlanEntry) (bool, error)

func (*DB) AddInvigilation

func (db *DB) AddInvigilation(ctx context.Context, room string, day, slot, invigilatorID int) error

func (*DB) AddNonZpaExam added in v1.3.0

func (db *DB) AddNonZpaExam(ctx context.Context, exam *model.ZPAExam) error

func (*DB) AddNta

func (db *DB) AddNta(ctx context.Context, nta *model.NTA) (*model.NTA, error)

func (*DB) AddPrePlannedInvigilation added in v1.84.0

func (db *DB) AddPrePlannedInvigilation(ctx context.Context, prePlannedInvigilation *model.PrePlannedInvigilation) (bool, error)

func (*DB) AddPrePlannedRoomToExam added in v1.33.0

func (db *DB) AddPrePlannedRoomToExam(ctx context.Context, prePlannedRoom *model.PrePlannedRoom) (bool, error)

func (*DB) AddStudentReg added in v1.36.0

func (db *DB) AddStudentReg(ctx context.Context, program string, ancode int, mtknr string) error

func (*DB) AddZpaExamToPlan

func (db *DB) AddZpaExamToPlan(ctx context.Context, ancode int) (bool, error)

func (*DB) AllAnnyBookings added in v1.77.0

func (db *DB) AllAnnyBookings(ctx context.Context) ([]*model.AnnyBooking, error)

func (*DB) AllSemesterNames

func (db *DB) AllSemesterNames() ([]*model.Semester, error)

func (*DB) AncodesInPlan

func (db *DB) AncodesInPlan(ctx context.Context) ([]int, error)

func (*DB) AnnyBookings added in v1.77.0

func (db *DB) AnnyBookings(ctx context.Context, room *string) ([]*model.AnnyBooking, error)

func (*DB) AnnyBookingsCollection added in v1.77.0

func (db *DB) AnnyBookingsCollection(ctx context.Context) *mongo.Collection

func (*DB) BackupPlan

func (db *DB) BackupPlan(ctx context.Context) error

func (*DB) CacheGeneratedExams

func (db *DB) CacheGeneratedExams(ctx context.Context, exams []*model.GeneratedExam) error

func (*DB) CacheInvigilatorTodos

func (db *DB) CacheInvigilatorTodos(ctx context.Context, todos *model.InvigilationTodos) error

func (*DB) CacheTeachers

func (db *DB) CacheTeachers(teachers []*model.Teacher, semester string) error

func (*DB) CacheZPAExams

func (db *DB) CacheZPAExams(exams []*model.ZPAExam) error

func (*DB) ChangeAncode

func (db *DB) ChangeAncode(ctx context.Context, program string, ancode, newAncode int) (*model.PrimussExam, error)

func (*DB) ChangeAncodeInConflicts

func (db *DB) ChangeAncodeInConflicts(ctx context.Context, program string, ancode, newAncode int) (*model.Conflicts, error)

func (*DB) ChangeAncodeInStudentRegs

func (db *DB) ChangeAncodeInStudentRegs(ctx context.Context, program string, ancode, newAncode int) ([]*model.StudentReg, error)

func (*DB) ChangeAncodeInStudentRegsCount

func (db *DB) ChangeAncodeInStudentRegsCount(ctx context.Context, program string, ancode, newAncode int) error

func (*DB) CheckStudentRegsCount

func (db *DB) CheckStudentRegsCount(ctx context.Context, program string, ancode, studentRegsCount int) bool

func (*DB) DropAndSave

func (db *DB) DropAndSave(ctx context.Context, objects []interface{}) error

func (*DB) Exahm

func (db *DB) Exahm(ctx context.Context, ancode int) (bool, error)

func (*DB) ExamIsLocked

func (db *DB) ExamIsLocked(ctx context.Context, ancode int) bool

func (*DB) ExamerInPlan

func (db *DB) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error)

func (*DB) ExamsInSlot

func (db *DB) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExam, error)

func (*DB) ExcludeDays

func (db *DB) ExcludeDays(ctx context.Context, ancode int, days []*time.Time) (bool, error)

func (*DB) GetAddedAncodes

func (db *DB) GetAddedAncodes(ctx context.Context) (map[int][]model.ZPAPrimussAncodes, error)

func (*DB) GetAddedAncodesForAncode

func (db *DB) GetAddedAncodesForAncode(ctx context.Context, ancode int) ([]model.ZPAPrimussAncodes, error)

func (*DB) GetAllInvigilations

func (db *DB) GetAllInvigilations(ctx context.Context) ([]*model.Invigilation, error)

func (*DB) GetConnectedExam

func (db *DB) GetConnectedExam(ctx context.Context, ancode int) (*model.ConnectedExam, error)

func (*DB) GetConnectedExams

func (db *DB) GetConnectedExams(ctx context.Context) ([]*model.ConnectedExam, error)

func (*DB) GetConstraints

func (db *DB) GetConstraints(ctx context.Context) ([]*model.Constraints, error)

func (*DB) GetConstraintsForAncode

func (db *DB) GetConstraintsForAncode(ctx context.Context, ancode int) (*model.Constraints, error)

func (*DB) GetGeneratedExam

func (db *DB) GetGeneratedExam(ctx context.Context, ancode int) (*model.GeneratedExam, error)

func (*DB) GetGeneratedExams

func (db *DB) GetGeneratedExams(ctx context.Context) ([]*model.GeneratedExam, error)

func (*DB) GetGeneratedExamsForExamer

func (db *DB) GetGeneratedExamsForExamer(ctx context.Context, examerID int) ([]*model.GeneratedExam, error)

func (*DB) GetInvigilationInSlot

func (db *DB) GetInvigilationInSlot(ctx context.Context, roomname string, day, slot int) ([]*model.Invigilation, error)

func (*DB) GetInvigilationTodos

func (db *DB) GetInvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error)

func (*DB) GetInvigilatorForRoom

func (db *DB) GetInvigilatorForRoom(ctx context.Context, name string, day, time int) (*model.Teacher, error)

func (*DB) GetInvigilatorInSlot

func (db *DB) GetInvigilatorInSlot(ctx context.Context, roomname string, day, slot int) (*model.Teacher, error)

func (*DB) GetInvigilatorRequirements

func (db *DB) GetInvigilatorRequirements(ctx context.Context, teacherID int) (*zpa.SupervisorRequirements, error)

func (*DB) GetInvigilators

func (db *DB) GetInvigilators(ctx context.Context) ([]*model.Teacher, error)

func (*DB) GetOtherInvigilations

func (db *DB) GetOtherInvigilations(ctx context.Context) ([]*model.Invigilation, error)

func (*DB) GetPlanEntriesInSlot added in v1.23.0

func (db *DB) GetPlanEntriesInSlot(ctx context.Context, day int, time int) ([]*model.PlanEntry, error)

func (*DB) GetPrimussConflictsForAncode

func (db *DB) GetPrimussConflictsForAncode(ctx context.Context, program string, ancode int) (*model.Conflicts, error)

func (*DB) GetPrimussConflictsForAncodeOnlyPlanned

func (db *DB) GetPrimussConflictsForAncodeOnlyPlanned(ctx context.Context, program string, ancode int, zpaExamsToPlan []*model.ZPAExam) (*model.Conflicts, error)

func (*DB) GetPrimussExam

func (db *DB) GetPrimussExam(ctx context.Context, program string, ancode int) (*model.PrimussExam, error)

func (*DB) GetPrimussExams

func (db *DB) GetPrimussExams(ctx context.Context) ([]*model.PrimussExamByProgram, error)

func (*DB) GetPrimussExamsForAncode

func (db *DB) GetPrimussExamsForAncode(ctx context.Context, ancode int) ([]*model.PrimussExam, error)

func (*DB) GetPrimussStudentRegsForProgrammAncode

func (db *DB) GetPrimussStudentRegsForProgrammAncode(ctx context.Context, program string, ancode int) ([]*model.StudentReg, error)

func (*DB) GetPrimussStudentRegsPerAncode

func (db *DB) GetPrimussStudentRegsPerAncode(ctx context.Context, program string) (map[int][]*model.StudentReg, error)

func (*DB) GetPrimussStudentRegsPerStudent

func (db *DB) GetPrimussStudentRegsPerStudent(ctx context.Context, program string) (map[string][]*model.StudentReg, error)

func (*DB) GetPrograms

func (db *DB) GetPrograms(ctx context.Context) ([]string, error)

func (*DB) GetRegsWithErrors

func (db *DB) GetRegsWithErrors(ctx context.Context) ([]*model.RegWithError, error)

func (*DB) GetSelfInvigilations

func (db *DB) GetSelfInvigilations(ctx context.Context) ([]*model.Invigilation, error)

func (*DB) GetStudentRegsCount

func (db *DB) GetStudentRegsCount(ctx context.Context, program string, ancode int) (int, error)

func (*DB) GetTeacher

func (db *DB) GetTeacher(ctx context.Context, id int) (*model.Teacher, error)

func (*DB) GetTeacherIdByRegex added in v1.39.0

func (db *DB) GetTeacherIdByRegex(ctx context.Context, name string) (int, error)

func (*DB) GetTeachers

func (db *DB) GetTeachers(ctx context.Context) ([]*model.Teacher, error)

func (*DB) GetZPAExams

func (db *DB) GetZPAExams(ctx context.Context) ([]*model.ZPAExam, error)

func (*DB) GetZPAExamsNotToPlan

func (db *DB) GetZPAExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error)

func (*DB) GetZPAExamsPlannedOrNotPlanned

func (db *DB) GetZPAExamsPlannedOrNotPlanned(ctx context.Context) ([]*model.ZPAExam, error)

func (*DB) GetZPAExamsToPlan

func (db *DB) GetZPAExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error)

func (*DB) GetZPAStudentByMtknr added in v1.61.0

func (db *DB) GetZPAStudentByMtknr(ctx context.Context, mtknr string) (*model.ZPAStudent, error)

func (*DB) GetZPAStudents added in v1.62.0

func (db *DB) GetZPAStudents(ctx context.Context) ([]*model.ZPAStudent, error)

func (*DB) GetZpaAncodesNotPlanned

func (db *DB) GetZpaAncodesNotPlanned(ctx context.Context) (*set.Set[int], error)

func (*DB) GetZpaAncodesPlanned

func (db *DB) GetZpaAncodesPlanned(ctx context.Context) (*set.Set[int], error)

func (*DB) GetZpaAncodesPlannedOrNotPlanned

func (db *DB) GetZpaAncodesPlannedOrNotPlanned(ctx context.Context) (*set.Set[int], error)

func (*DB) GetZpaExamByAncode

func (db *DB) GetZpaExamByAncode(ctx context.Context, ancode int) (*model.ZPAExam, error)

func (*DB) InvigilationsForInvigilator

func (db *DB) InvigilationsForInvigilator(ctx context.Context, invigilatorID int) ([]*model.Invigilation, error)

func (*DB) Lab

func (db *DB) Lab(ctx context.Context, ancode int) (bool, error)

func (*DB) LockExam

func (db *DB) LockExam(ctx context.Context, ancode int) (*model.PlanEntry, error)

func (*DB) LockPlan

func (db *DB) LockPlan(ctx context.Context) error

func (*DB) MucDaiExam added in v1.3.0

func (db *DB) MucDaiExam(ctx context.Context, program string, ancode int) (*MucDaiExam, error)

func (*DB) MucDaiExamsForProgram

func (db *DB) MucDaiExamsForProgram(ctx context.Context, program string) ([]*MucDaiExam, error)

func (*DB) NonZpaExam added in v1.3.0

func (db *DB) NonZpaExam(ctx context.Context, ancode int) (*model.ZPAExam, error)

func (*DB) NonZpaExams added in v1.3.0

func (db *DB) NonZpaExams(ctx context.Context) ([]*model.ZPAExam, error)

func (*DB) NotPlannedByMe

func (db *DB) NotPlannedByMe(ctx context.Context, ancode int) (bool, error)

func (*DB) Nta

func (db *DB) Nta(ctx context.Context, mtknr string) (*model.NTA, error)

func (*DB) NtaWithRegs

func (db *DB) NtaWithRegs(ctx context.Context, mtknr string) (*model.NTAWithRegs, error)

func (*DB) Ntas

func (db *DB) Ntas(ctx context.Context) ([]*model.NTA, error)

func (*DB) NtasWithRegs

func (db *DB) NtasWithRegs(ctx context.Context) ([]*model.Student, error)

func (*DB) Online

func (db *DB) Online(ctx context.Context, ancode int) (bool, error)

func (*DB) PlacesWithSockets

func (db *DB) PlacesWithSockets(ctx context.Context, ancode int) (bool, error)

func (*DB) PlanEntries

func (db *DB) PlanEntries(ctx context.Context) ([]*model.PlanEntry, error)

func (*DB) PlanEntry

func (db *DB) PlanEntry(ctx context.Context, ancode int) (*model.PlanEntry, error)

func (*DB) PlannedAncodes

func (db *DB) PlannedAncodes(ctx context.Context) ([]*model.PlanEntry, error)

func (*DB) PlannedRoomNames

func (db *DB) PlannedRoomNames(ctx context.Context) ([]string, error)

func (*DB) PlannedRoomNamesInSlot

func (db *DB) PlannedRoomNamesInSlot(ctx context.Context, day, slot int) ([]string, error)

func (*DB) PlannedRooms

func (db *DB) PlannedRooms(ctx context.Context) ([]*model.PlannedRoom, error)

func (*DB) PlannedRoomsForAncode

func (db *DB) PlannedRoomsForAncode(ctx context.Context, ancode int) ([]*model.PlannedRoom, error)

func (*DB) PlannedRoomsInSlot

func (db *DB) PlannedRoomsInSlot(ctx context.Context, day, slot int) ([]*model.PlannedRoom, error)

func (*DB) PossibleDays

func (db *DB) PossibleDays(ctx context.Context, ancode int, days []*time.Time) (bool, error)

func (*DB) PrePlannedInvigilations added in v1.84.0

func (db *DB) PrePlannedInvigilations(ctx context.Context) ([]*model.PrePlannedInvigilation, error)

func (*DB) PrePlannedInvigilationsForInvigilator added in v1.84.0

func (db *DB) PrePlannedInvigilationsForInvigilator(ctx context.Context, invigilatorID int) ([]*model.PrePlannedInvigilation, error)

func (*DB) PrePlannedRooms added in v1.33.0

func (db *DB) PrePlannedRooms(ctx context.Context) ([]*model.PrePlannedRoom, error)

func (*DB) PrePlannedRoomsForExam added in v1.50.0

func (db *DB) PrePlannedRoomsForExam(ctx context.Context, ancode int) ([]*model.PrePlannedRoom, error)

func (*DB) PrimussExamExists

func (db *DB) PrimussExamExists(ctx context.Context, program string, ancode int) (bool, error)

func (*DB) RemoveStudentReg

func (db *DB) RemoveStudentReg(ctx context.Context, program string, ancode int, mtknr string) (int, error)

func (*DB) ReplaceConnectedExam

func (db *DB) ReplaceConnectedExam(ctx context.Context, exam *model.ConnectedExam) error

func (*DB) ReplacePlannedRooms added in v1.34.0

func (db *DB) ReplacePlannedRooms(ctx context.Context, plannedRooms []*model.PlannedRoom) error

func (*DB) RmConstraints added in v1.20.0

func (db *DB) RmConstraints(ctx context.Context, ancode int) (bool, error)

func (*DB) RmZpaExamFromPlan

func (db *DB) RmZpaExamFromPlan(ctx context.Context, ancode int) (bool, error)

func (*DB) RoomByName added in v1.33.0

func (db *DB) RoomByName(ctx context.Context, roomName string) (*model.Room, error)

func (*DB) Rooms

func (db *DB) Rooms(ctx context.Context) ([]*model.Room, error)

func (*DB) RoomsForSlot

func (db *DB) RoomsForSlot(ctx context.Context, day int, time int) (*model.RoomsForSlot, error)

func (*DB) RoomsForSlots added in v1.31.0

func (db *DB) RoomsForSlots(ctx context.Context) ([]*model.RoomsForSlot, error)

func (*DB) SafeExamBrowser

func (db *DB) SafeExamBrowser(ctx context.Context, ancode int) (bool, error)

func (*DB) SameSlot

func (db *DB) SameSlot(ctx context.Context, ancode int, ancodes []int) (bool, error)

func (*DB) Save

func (db *DB) Save(ctx context.Context, objects []interface{}) error

func (*DB) SaveAnnyBookings added in v1.77.0

func (db *DB) SaveAnnyBookings(ctx context.Context, bookings []*model.AnnyBooking) error

func (*DB) SaveConnectedExam

func (db *DB) SaveConnectedExam(ctx context.Context, exam *model.ConnectedExam) error

func (*DB) SaveConnectedExams

func (db *DB) SaveConnectedExams(ctx context.Context, exams []*model.ConnectedExam) error

func (*DB) SavePlanEntries

func (db *DB) SavePlanEntries(ctx context.Context, planEntries []*model.PlanEntry) error

func (*DB) SavePlanEntriesToBackup

func (db *DB) SavePlanEntriesToBackup(ctx context.Context, planEntries []*model.PlanEntry) error

func (*DB) SaveRoomsForSlots added in v1.31.0

func (db *DB) SaveRoomsForSlots(ctx context.Context, roomsForSlots []*model.RoomsForSlot) error

func (*DB) SaveSemesterConfig

func (db *DB) SaveSemesterConfig(ctx context.Context, semesterConfig *model.SemesterConfig) error

func (*DB) SaveStudentRegs

func (db *DB) SaveStudentRegs(ctx context.Context, studentRegs []interface{}) error

func (*DB) SetInvigilationPrePlanned added in v1.85.0

func (db *DB) SetInvigilationPrePlanned(ctx context.Context, day, slot int, roomName *string, prePlanned bool) error

SetInvigilationPrePlanned sets the prePlanned flag on the invigilation for a room (roomName != nil) or the reserve (roomName == nil) in a slot in the invigilations_other collection.

func (*DB) SetRegsWithErrors

func (db *DB) SetRegsWithErrors(ctx context.Context, regsWithErrors []*model.RegWithError) error

func (*DB) SetSemesterOnNTAs

func (db *DB) SetSemesterOnNTAs(ctx context.Context, studentRegs []interface{}) error

func (*DB) SetZPAExamsToPlan

func (db *DB) SetZPAExamsToPlan(ctx context.Context, examsToPlan, examsNotToPlan []*model.ZPAExam) error

func (*DB) StudentByMtknr

func (db *DB) StudentByMtknr(ctx context.Context, mtknr string) (*model.Student, error)

func (*DB) StudentRegsForProgram

func (db *DB) StudentRegsForProgram(ctx context.Context, program string) ([]*model.StudentReg, error)

func (*DB) StudentRegsPerStudentPlanned

func (db *DB) StudentRegsPerStudentPlanned(ctx context.Context) ([]*model.Student, error)

func (*DB) StudentsByName

func (db *DB) StudentsByName(ctx context.Context, regex string) ([]*model.Student, error)

func (*DB) UnlockExam

func (db *DB) UnlockExam(ctx context.Context, ancode int) (*model.PlanEntry, error)

type ExamToPlanType

type ExamToPlanType struct {
	Ancode int
	ToPlan bool
}

type MucDaiExam

type MucDaiExam struct {
	PrimussAncode  int    `bson:"Nr"`
	Module         string `bson:"Modulname"`
	ExamType       string `bson:"Prüfungsform"`
	Grading        string `bson:"Bewertung"`
	Duration       int    `bson:"Dauer"`
	MainExamer     string `bson:"Erstpruefender"`
	SecondExamer   string `bson:"Zweitpruefender"`
	IsRepeaterExam string `bson:"IstWiederholung"`
	Program        string `bson:"Studiengruppe"`
	Planer         string `bson:"Prüfungsplanung"`
}

type PrimussExam

type PrimussExam struct {
	Ancode  int    `bson:"ancode"`
	Program string `bson:"program"`
}

type PrimussType

type PrimussType string
const (
	StudentRegs PrimussType = "studentregs"
	Exams       PrimussType = "exams"
	Counts      PrimussType = "count"
	Conflicts   PrimussType = "conflicts"
)

Jump to

Keyboard shortcuts

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