Documentation
¶
Overview ¶
Package models contains all database tables as structs and their validation functions. It also contains additional structs representing front end data, such as the user login credentials.
Index ¶
- Constants
- Variables
- func BelongsToElement(table, column1, column2 string, ID1, ID2 int) (belongs bool, err error)
- func GetEMailSubjectBody(data *EMailData, language *string, subjectKey string, filename string, ...) (err error)
- func ValidateLength(str *string, msgKey string, min, max int, v *revel.Validation)
- func ValidateLengthAndValid(str *sql.NullString, msgKey string, min, max int, v *revel.Validation)
- type Affiliations
- type CalendarEvent
- func (event *CalendarEvent) Delete(v *revel.Validation) (users []EMailData, err error)
- func (event *CalendarEvent) Duplicate(tx *sqlx.Tx) (err error)
- func (event *CalendarEvent) Get(tx *sqlx.Tx, courseID *int, monday time.Time, userID int) (err error)
- func (event *CalendarEvent) GetColumnValue(tx *sqlx.Tx, column string) (err error)
- func (event *CalendarEvent) Insert(tx *sqlx.Tx, courseID int) (err error)
- func (event *CalendarEvent) NewBlank() (err error)
- func (event *CalendarEvent) Update(column string, value interface{}) (err error)
- type CalendarEvents
- type Categories
- type Category
- type ChildHasCourseLimit
- type Course
- func (course *Course) Activate(v *revel.Validation) (invalid bool, users EMailsData, err error)
- func (course *Course) Delete() (valid bool, err error)
- func (course *Course) Duplicate() (err error)
- func (course *Course) Get(tx *sqlx.Tx, manage bool, userID int) (err error)
- func (course *Course) GetColumnValue(tx *sqlx.Tx, column string) (err error)
- func (course *Course) GetForEnrollment(tx *sqlx.Tx, userID, eventID *int) (err error)
- func (course *Course) GetForValidation(tx *sqlx.Tx) (err error)
- func (course *Course) GetVisible(elem string) (err error)
- func (course *Course) InsertFromDraft(v *revel.Validation) (err error)
- func (course *Course) InsertUploadedCourse() (err error)
- func (course *Course) Load(version int, data *[]byte) (success bool, err error)
- func (course *Course) NewBlank() (err error)
- func (course *Course) Update(tx *sqlx.Tx, column string, value interface{}, conf *EditEMailConfig) (err error)
- func (course *Course) UpdateTimestamp(v *revel.Validation, conf *EditEMailConfig, fieldID string, t time.Time, ...) (err error)
- func (course *Course) Validate(v *revel.Validation)
- type CourseList
- func (list *CourseList) Get(active, expired bool, userID int, role string) (editor, instructor CourseList, err error)
- func (list *CourseList) GetByUserID(tx *sqlx.Tx, userID int, userType string, active, expired bool) (err error)
- func (list *CourseList) Search(value string) (err error)
- func (list *CourseList) SearchForDrafts(value string, userID int, role string) (err error)
- type CourseListInfo
- type CourseOfStudies
- type CourseStatus
- type Courses
- type CoursesOfStudies
- type Credentials
- type CustomEMailData
- type CustomTime
- func (t1 *CustomTime) After(t2 *CustomTime) (after bool)
- func (t1 *CustomTime) Before(t2 *CustomTime) (before bool)
- func (t1 *CustomTime) Equals(t2 *CustomTime) (equals bool)
- func (t1 *CustomTime) SetTime(value string) (success bool)
- func (t1 *CustomTime) String()
- func (t1 *CustomTime) Sub(t2 *CustomTime) (min int)
- type Day
- type DayTmpl
- type DayTmpls
- type Days
- type Degree
- type Degrees
- type EMailData
- type EMailsData
- type EditEMailConfig
- type EnrollOption
- type Enrolled
- func (enrolled *Enrolled) ChangeStatus(courseID *int, v *revel.Validation) (data EMailData, err error)
- func (enrolled *Enrolled) Enroll(courseID *int, v *revel.Validation) (data EMailData, err error)
- func (enrolled *Enrolled) EnrollOrUnsubscribe(action EnrollOption, key string) (data EMailData, waitList bool, users Users, msg string, err error)
- func (enrolled *Enrolled) Unsubscribe(courseID *int, v *revel.Validation) (data EMailData, users Users, err error)
- func (enrolled *Enrolled) Waitlist(courseID *int, v *revel.Validation) (data EMailData, users Users, err error)
- type EnrollmentStatus
- type Enrollments
- type Entries
- type Entry
- type Event
- func (event *Event) Delete(v *revel.Validation) (err error)
- func (event *Event) Duplicate(tx *sqlx.Tx) (err error)
- func (event *Event) Get(tx *sqlx.Tx) (err error)
- func (event *Event) GetColumnValue(tx *sqlx.Tx, column string) (err error)
- func (event *Event) NewBlank(conf *EditEMailConfig) (err error)
- func (event *Event) Update(tx *sqlx.Tx, column string, value interface{}, conf *EditEMailConfig) (users EMailsData, err error)
- func (event *Event) UpdateComments(option bool, v *revel.Validation) (err error)
- func (event *Event) UpdateKey() (err error)
- func (event *Event) UpdateWaitlist(option bool, v *revel.Validation) (err error)
- type EventStatus
- type Events
- func (events *Events) Duplicate(tx *sqlx.Tx, courseIDNew, courseIDOld *int) (err error)
- func (events *Events) Get(tx *sqlx.Tx, userID, courseID *int, manage bool, limit *sql.NullInt32) (err error)
- func (events *Events) GetForValidation(tx *sqlx.Tx, courseID *int) (err error)
- func (events *Events) Insert(tx *sqlx.Tx, courseID *int) (err error)
- type Exception
- type Exceptions
- type ExceptionsOfWeek
- type Group
- type Groups
- type HelpPageEntries
- type HelpPageEntry
- type IsTimestamp
- type LanguageValidator
- type ListConf
- type LogEntries
- type LogEntry
- type Meeting
- func (meeting *Meeting) Delete(conf *EditEMailConfig) (err error)
- func (meeting *Meeting) Duplicate(conf *EditEMailConfig) (err error)
- func (meeting *Meeting) NewBlank(conf *EditEMailConfig) (err error)
- func (meeting *Meeting) Update(conf *EditEMailConfig) (err error)
- func (meeting *Meeting) Validate(v *revel.Validation)
- type MeetingInterval
- type Meetings
- type NewCourseParam
- type NoActiveChildren
- type NotRequired
- type NotUnique
- type NullAffiliations
- type Option
- type ParentHasCourseLimit
- type ParticipantList
- type ParticipantLists
- type Participants
- type Restriction
- type Restrictions
- type Role
- type Salutation
- type Schedule
- type ScheduleEntry
- type ScheduleEntryType
- type Slot
- func (slot *Slot) BelongsToEvent(eventID int) (belongs bool, err error)
- func (slot *Slot) Delete(v *revel.Validation) (data EMailData, err error)
- func (slot *Slot) DeleteManual() (data EMailData, err error)
- func (slot *Slot) Get(tx *sqlx.Tx) (err error)
- func (slot *Slot) Insert(v *revel.Validation, calendarEventID int, manual bool) (data EMailData, err error)
- type Slots
- type Studies
- type Study
- type Unique
- type Unsubscribed
- type User
- func (user *User) AuthorizedToEdit(table *string, ID *int) (authorized, expired bool, err error)
- func (user *User) ChangeRole() (err error)
- func (user *User) ChangeUserData(v *revel.Validation) (err error)
- func (user *User) GenerateNewPassword(v *revel.Validation) (err error)
- func (user *User) Get(tx *sqlx.Tx) (err error)
- func (user *User) GetBasicData(tx *sqlx.Tx) (err error)
- func (user *User) GetNavigationData() (err error)
- func (user *User) GetProfileData() (err error)
- func (user *User) HasElevatedRights(ID *int, table string) (authorized, expired bool, err error)
- func (user *User) IsEditorInstructor(tx *sqlx.Tx) (bool, bool, error)
- func (user *User) Login() (err error)
- func (user *User) NewActivationCode() (err error)
- func (user *User) NewPassword(newPw1, newPw2 string, v *revel.Validation) (err error)
- func (user *User) Register(v *revel.Validation) (err error)
- func (user *User) SetPrefLanguage() (err error)
- func (user *User) Validate(tx *sqlx.Tx, v *revel.Validation)
- func (user *User) ValidateRegister(tx *sqlx.Tx, v *revel.Validation)
- func (user *User) VerifyActivationCode() (success bool, err error)
- type UserDetails
- type UserList
- func (users *UserList) Duplicate(tx *sqlx.Tx, courseIDNew, courseIDOld *int, table string) (err error)
- func (users *UserList) Get(tx *sqlx.Tx, courseID *int, table string) (err error)
- func (users *UserList) GetEditorsInstructors(courseID *int) (instructors UserList, err error)
- func (users *UserList) InsertUploaded(tx *sqlx.Tx, courseID *int, table string) (err error)
- func (users *UserList) Search(value, listType *string, searchInactive *bool, courseID *int) (err error)
- type UserListEntry
- func (user *UserListEntry) Delete(table string) (active bool, data EMailData, err error)
- func (user *UserListEntry) Exists(tx *sqlx.Tx) (exists bool, err error)
- func (user *UserListEntry) Insert(table string) (active bool, data EMailData, err error)
- func (user *UserListEntry) Update(table string) (active bool, data EMailData, err error)
- type Users
- type ValidateUniqueData
- type Version2Course
- type Version2Event
- type Version2Limitations
- type Version2Meeting
- type Version2UserList
- type Version3Course
Constants ¶
const ( //BoolTrue ... BoolTrue = "true" //TableFAQCategory DB table name TableFAQCategory = "faq_category" //TableNewsFeedCategory DB table name TableNewsFeedCategory = "news_feed_category" //EventTypeNormal allows users to enroll in normal events EventTypeNormal = "normal" //EventTypeCalendar allows users to enroll in calender slots EventTypeCalendar = "calendar" //TableAllowlists DB table name TableAllowlists = "allowlists" //TableBlocklists DB table name TableBlocklists = "blocklists" //TableInstructors DB table name TableInstructors = "instructors" //TableEditors DB table name TableEditors = "editors" //ColTitle DB column name ColTitle = "title" //ColAnnotation DB column name ColAnnotation = "annotation" //ColHasComments DB column name ColHasComments = "has_comments" //ColHasWaitlist DB column name ColHasWaitlist = "has_waitlist" //ColEnrollmentStart DB column name ColEnrollmentStart = "enrollment_start" //ColEnrollmentEnd DB column name ColEnrollmentEnd = "enrollment_end" //ColExpirationDate DB column name ColExpirationDate = "expiration_date" //ColUnsubscribeEnd DB column name ColUnsubscribeEnd = "unsubscribe_end" //ColVisible DB column name ColVisible = "visible" //ColOnlyLDAP DB column name ColOnlyLDAP = "only_ldap" //ColFee DB column name ColFee = "fee" //ColSubtitle DB column name ColSubtitle = "subtitle" //ColDescription DB column name ColDescription = "description" //ColSpeaker DB column name ColSpeaker = "speaker" //ColCustomEMail DB column name ColCustomEMail = "custom_email" )
Variables ¶
var FeePattern = regexp.MustCompile("^([0-9]{1,6}([,|.][0-9]{0,2})?)?")
FeePattern is the regular expression of accepted course fees
Functions ¶
func BelongsToElement ¶
BelongsToElement returns whether e.g. an event belongs to a course.
func GetEMailSubjectBody ¶
func GetEMailSubjectBody(data *EMailData, language *string, subjectKey string, filename string, email *app.EMail, c *revel.Controller) (err error)
GetEMailSubjectBody assigns the template content to the e-mail body and sets the e-mail subject.
func ValidateLength ¶
func ValidateLength(str *string, msgKey string, min, max int, v *revel.Validation)
ValidateLength of a not null string.
func ValidateLengthAndValid ¶
func ValidateLengthAndValid(str *sql.NullString, msgKey string, min, max int, v *revel.Validation)
ValidateLengthAndValid sets valid to true if the string is not empty and also validates its length (if non-empty).
Types ¶
type CalendarEvent ¶
type CalendarEvent struct { ID int `db:"id"` CourseID int `db:"course_id"` Title string `db:"title"` Annotation sql.NullString `db:"annotation"` //loaded week Monday time.Time Week int Year int //day templates for this week [0...6] Days Days //all upcoming exceptions Exceptions Exceptions //exeptions of this week ExceptionsOfWeek ExceptionsOfWeek //transformed schedule for easy front end usage ScheduleWeek []Schedule //used for enrollment NoEnroll bool NoUnsubscribe bool EnrollMsg string }
CalendarEvent is a special calendar-based event of a course.
func (*CalendarEvent) Delete ¶
func (event *CalendarEvent) Delete(v *revel.Validation) (users []EMailData, err error)
Delete a calendar event.
func (*CalendarEvent) Duplicate ¶
func (event *CalendarEvent) Duplicate(tx *sqlx.Tx) (err error)
Duplicate an calendar event.
func (*CalendarEvent) Get ¶
func (event *CalendarEvent) Get(tx *sqlx.Tx, courseID *int, monday time.Time, userID int) (err error)
Get a calendar event by its ID and a monday.
func (*CalendarEvent) GetColumnValue ¶
func (event *CalendarEvent) GetColumnValue(tx *sqlx.Tx, column string) (err error)
GetColumnValue returns the value of a specific column.
func (*CalendarEvent) Insert ¶
func (event *CalendarEvent) Insert(tx *sqlx.Tx, courseID int) (err error)
Insert a calendar event into a given Course_ID
func (*CalendarEvent) NewBlank ¶
func (event *CalendarEvent) NewBlank() (err error)
NewBlank creates a new blank calendar event.
func (*CalendarEvent) Update ¶
func (event *CalendarEvent) Update(column string, value interface{}) (err error)
Update the specific column in the calendar event.
type CalendarEvents ¶
type CalendarEvents []CalendarEvent
CalendarEvents holds all calendar events of a course.
func (*CalendarEvents) Duplicate ¶
func (events *CalendarEvents) Duplicate(tx *sqlx.Tx, courseIDNew, courseIDOld *int) (err error)
Duplicate all calendar events of a course.
type Categories ¶
type Categories []Category
Categories holds all categories of either the FAQs or the news feed.
func (*Categories) Select ¶
func (categories *Categories) Select(table string) (err error)
Select all categories and their respective entries from either the FAQs or the NewsFeed table.
type Category ¶
type Category struct { ID int `db:"id, primarykey, autoincrement"` Name string `db:"name"` LastEditor sql.NullInt32 `db:"last_editor"` LastEdited string `db:"last_edited"` Entries HelpPageEntries `` }
Category is a model of the category table. Categories are used for grouping the entries of the FAQs (faq_category) and the news feed (news_feed_category).
func (*Category) Validate ¶
func (category *Category) Validate(v *revel.Validation)
Validate Category fields.
type ChildHasCourseLimit ¶
type ChildHasCourseLimit struct{}
ChildHasCourseLimit implements whether any child group has a course limit or not.
func (ChildHasCourseLimit) DefaultMessage ¶
func (courseLimit ChildHasCourseLimit) DefaultMessage() string
DefaultMessage returns the default message of ChildHasCourseLimit.
func (ChildHasCourseLimit) IsSatisfied ¶
func (courseLimit ChildHasCourseLimit) IsSatisfied(i interface{}) bool
IsSatisfied implements the validation result of ChildHasCourseLimit.
type Course ¶
type Course struct { ID int `db:"id, primarykey, autoincrement"` Title string `db:"title"` Creator sql.NullInt32 `db:"creator"` Subtitle sql.NullString `db:"subtitle"` Visible bool `db:"visible"` Active bool `db:"active"` OnlyLDAP bool `db:"only_ldap"` CreationDate time.Time `db:"creation_date"` Description sql.NullString `db:"description"` Speaker sql.NullString `db:"speaker"` Fee sql.NullFloat64 `db:"fee"` CustomEMail sql.NullString `db:"custom_email"` EnrollLimitEvents sql.NullInt32 `db:"enroll_limit_events"` EnrollmentStart time.Time `db:"enrollment_start"` EnrollmentEnd time.Time `db:"enrollment_end"` UnsubscribeEnd sql.NullTime `db:"unsubscribe_end"` ExpirationDate time.Time `db:"expiration_date"` ParentID sql.NullInt32 `db:"parent_id"` //course data of different tables Events Events `` CalendarEvents CalendarEvents `` Editors UserList `` Instructors UserList `` Blocklist UserList `` Allowlist UserList `` Restrictions Restrictions `` //additional information required when displaying the course CreatorData User `` //path to the course entry in the groups tree Path Groups `` //used for correct template rendering CreatorID string Expired bool //used to add/edit course restrictions CoursesOfStudies CoursesOfStudies Degrees Degrees //used for enrollment CourseStatus CourseStatus Manage bool //used to render buttons for redirect CanEdit bool `db:"can_edit"` CanManageParticipants bool `db:"can_manage_participants"` IsCreator bool //used for pretty timestamp rendering CreationDateStr string `db:"creation_date_str"` EnrollmentStartStr string `db:"enrollment_start_str"` EnrollmentEndStr string `db:"enrollment_end_str"` UnsubscribeEndStr sql.NullString `db:"unsubscribe_end_str"` ExpirationDateStr string `db:"expiration_date_str"` }
Course is a model of the course table.
func (*Course) Activate ¶
func (course *Course) Activate(v *revel.Validation) (invalid bool, users EMailsData, err error)
Activate a course.
func (*Course) Get ¶
Get all course data. If manage is false, only get publicly available course data. Also, if it is false, get enrollment information for this user for each event.
func (*Course) GetColumnValue ¶
GetColumnValue returns the value of a specific column.
func (*Course) GetForEnrollment ¶
GetForEnrollment returns only the information required for enrollment.
func (*Course) GetForValidation ¶
GetForValidation only returns the course data required for validation.
func (*Course) GetVisible ¶
GetVisible of a course.
func (*Course) InsertFromDraft ¶
func (course *Course) InsertFromDraft(v *revel.Validation) (err error)
InsertFromDraft inserts a new course by duplicating an existing course.
func (*Course) InsertUploadedCourse ¶
InsertUploadedCourse a new course from a provided course struct. The course struct is extracted from an uploaded JSON file.
func (*Course) Load ¶
Load a course from a JSON file. The JSON can have the struct of the old Turm2.
func (*Course) Update ¶
func (course *Course) Update(tx *sqlx.Tx, column string, value interface{}, conf *EditEMailConfig) (err error)
Update the specified column in the course table.
func (*Course) UpdateTimestamp ¶
func (course *Course) UpdateTimestamp(v *revel.Validation, conf *EditEMailConfig, fieldID string, t time.Time, valid bool) (err error)
UpdateTimestamp of a course. Also ensures validitiy, if the course is already active.
func (*Course) Validate ¶
func (course *Course) Validate(v *revel.Validation)
Validate all course fields.
type CourseList ¶
type CourseList []CourseListInfo
CourseList holds the most essential information about a list of courses.
func (*CourseList) Get ¶
func (list *CourseList) Get(active, expired bool, userID int, role string) ( editor, instructor CourseList, err error)
Get the course lists for the specified users.
func (*CourseList) GetByUserID ¶
func (list *CourseList) GetByUserID(tx *sqlx.Tx, userID int, userType string, active, expired bool) (err error)
GetByUserID returns all courses according to the user type.
func (*CourseList) Search ¶
func (list *CourseList) Search(value string) (err error)
Search all courses.
func (*CourseList) SearchForDrafts ¶
func (list *CourseList) SearchForDrafts(value string, userID int, role string) (err error)
SearchForDrafts returns all courses that can be duplicated by a creator.
type CourseListInfo ¶
type CourseListInfo struct { ID int `db:"id, primarykey, autoincrement"` Title string `db:"title"` CreationDate time.Time `db:"creation_date"` CreationDateStr string `db:"creation_date_str"` EMail string `db:"email"` //e-mail address of either the creator or the editor }
CourseListInfo holds only the most essential information about courses.
type CourseOfStudies ¶
CourseOfStudies of a student.
type CourseStatus ¶
type CourseStatus struct { AtBlocklist bool AtAllowlist bool UnsubscribeOver bool `db:"unsubscribe_over"` NoEnrollmentPeriod bool `db:"no_enrollment_period"` NotSatisfyRestrictions bool NotLDAP bool MaxEnrollCoursesReached bool MaxEnrollCourses int `db:"limit"` }
CourseStatus validates the enrollment status of an user for a course.
type CoursesOfStudies ¶
type CoursesOfStudies []CourseOfStudies
CoursesOfStudies holds all existing courses of studies.
type Credentials ¶
Credentials entered at the login page.
func (*Credentials) Validate ¶
func (credentials *Credentials) Validate(v *revel.Validation)
Validate the credentials.
type CustomEMailData ¶
type CustomEMailData struct { Salutation Salutation `db:"salutation"` Title sql.NullString `db:"title"` NameAffix sql.NullString `db:"name_affix"` AcademicTitle sql.NullString `db:"academic_title"` LastName string `db:"last_name"` FirstName string `db:"first_name"` CourseID int `db:"course_id"` CourseTitle string `db:"course_title"` EventTitle string `db:"event_title"` MeetingCount int `db:"meeting_count"` EMailCreator string `db:"email_creator"` Start string `db:"start"` End string `db:"end"` URL string }
CustomEMailData contains all fields that can be used in the custom e-mail.
type CustomTime ¶
CustomTime is used to compare times.
func (*CustomTime) After ¶
func (t1 *CustomTime) After(t2 *CustomTime) (after bool)
After checks if t1 is after (>) t2.
func (*CustomTime) Before ¶
func (t1 *CustomTime) Before(t2 *CustomTime) (before bool)
Before checks if t1 is before or equal (<=) t2.
func (*CustomTime) Equals ¶
func (t1 *CustomTime) Equals(t2 *CustomTime) (equals bool)
Equals checks if t1 equals t2.
func (*CustomTime) SetTime ¶
func (t1 *CustomTime) SetTime(value string) (success bool)
SetTime uses a time string of format '12:50'. If value is a valid time it sets hour and min.
func (*CustomTime) String ¶
func (t1 *CustomTime) String()
String sets the value field of the CustomTime struct.
func (*CustomTime) Sub ¶
func (t1 *CustomTime) Sub(t2 *CustomTime) (min int)
Sub returns the time interval between two times.
type DayTmpl ¶
type DayTmpl struct { ID int `db:"id"` CalendarEventID int `db:"calendar_event_id"` StartTime string `db:"start_time"` EndTime string `db:"end_time"` Interval int `db:"interval"` DayOfWeek int `db:"day_of_week"` //must be an integer between [0, 6] Slots Slots }
DayTmpl is a section of a week day (Monday - Sunday).
func (*DayTmpl) Delete ¶
func (tmpl *DayTmpl) Delete() (users EMailsData, err error)
Delete a day template if it has no slots.
type EMailData ¶
type EMailData struct { //used for salutation, user specific changes (new pw, role, activation, ...) User User //used for linking to the page URL string //used for enrollment CourseTitle string `db:"course_title"` EventTitle string `db:"event_title"` CourseID int `db:"course_id"` CustomEMail sql.NullString `db:"custom_email"` //used for changing the enrollment status Status EnrollmentStatus //new course role type CourseRole string ViewMatrNr bool //used for slot enrollments Start string `db:"start"` End string `db:"end"` UserID int `db:"user_id"` //used for notifying users about edits Field string //used for the custom enrollment e-mail CustomEMailData CustomEMailData }
EMailData holds all data that is rendered in the different e-mail templates.
type EditEMailConfig ¶
type EditEMailConfig struct { OptionUsers int OptionEditors int ID int IsEvent bool IsCalendarEvent bool Users Users EditorsInstructors Users CourseTitle string `db:"course_title"` EventTitle string `db:"event_title"` CourseID int `db:"course_id"` Field string }
EditEMailConfig provides all information for sending edit notification e-mails.
type EnrollOption ¶
type EnrollOption int
EnrollOption is a type for encoding different enrollment options.
const ( //ENROLL is for normally enrolling in an event ENROLL EnrollOption = iota //UNSUBSCRIBE is for normally unsubscribing from an event UNSUBSCRIBE //NOENROLL disables the enrollment button NOENROLL //NOUNSUBSCRIBE disables the unsubscribe button NOUNSUBSCRIBE //ENROLLTOWAITLIST is for enrolling to the wait list ENROLLTOWAITLIST //UNSUBSCRIBEFROMWAITLIST is for unsubscribing from the wait list UNSUBSCRIBEFROMWAITLIST )
func (EnrollOption) String ¶
func (s EnrollOption) String() string
type Enrolled ¶
type Enrolled struct { UserID int `db:"user_id, primarykey"` EventID int `db:"event_id, primarykey"` Status EnrollmentStatus `db:"status"` TimeOfEnrollment time.Time `db:"time_of_enrollment"` Comment sql.NullString `db:"comment"` //used for pretty timestamp rendering TimeOfEnrollmentStr string `db:"time_of_enrollment_str"` //used for profile page CourseID int `db:"course_id"` CourseTitle string `db:"course_title"` EventTitle string `db:"event_title"` Start string `db:"start"` End string `db:"end"` }
Enrolled is a model of the enrolled table.
func (*Enrolled) ChangeStatus ¶
func (enrolled *Enrolled) ChangeStatus(courseID *int, v *revel.Validation) (data EMailData, err error)
ChangeStatus updates the enrollment status of a user.
func (*Enrolled) EnrollOrUnsubscribe ¶
func (enrolled *Enrolled) EnrollOrUnsubscribe(action EnrollOption, key string) (data EMailData, waitList bool, users Users, msg string, err error)
EnrollOrUnsubscribe a user in/from an event.
func (*Enrolled) Unsubscribe ¶
func (enrolled *Enrolled) Unsubscribe(courseID *int, v *revel.Validation) (data EMailData, users Users, err error)
Unsubscribe a user via participants management.
type EnrollmentStatus ¶
type EnrollmentStatus int
EnrollmentStatus is a type for encoding the enrollment status.
const ( //ENROLLED users enrolled in an event ENROLLED EnrollmentStatus = iota //ONWAITLIST users are at the waitlist of an event ONWAITLIST //AWAITINGPAYMENT users enrolled in an event but did not yet pay the fee of the course AWAITINGPAYMENT //PAID users enrolled in an event and did pay the fee of the course PAID //FREED users enrolled in an event and do not have to pay the fee of the course FREED //UNSUBSCRIBED users unsubscribed from an event UNSUBSCRIBED )
func (EnrollmentStatus) String ¶
func (status EnrollmentStatus) String() string
type Enrollments ¶
type Enrollments []Enrolled
Enrollments of a user.
func (*Enrollments) SelectByCourse ¶
func (enrollments *Enrollments) SelectByCourse(tx *sqlx.Tx, userID, courseID *int) (err error)
SelectByCourse selects all enrollments of a user for a specific course.
func (*Enrollments) SelectByUser ¶
SelectByUser returns all enrollments of a user.
func (*Enrollments) SelectSlotsByUser ¶
func (enrollments *Enrollments) SelectSlotsByUser(tx *sqlx.Tx, userID *int, expired bool) (err error)
SelectSlotsByUser returns all slot enrollments of a user.
type Entries ¶
type Entries []Entry
Entries of all users on either the participants list, the wait list or the unsubscribed list.
type Entry ¶
Entry of a user on either the participants list, the wait list or the unsubscribed list.
type Event ¶
type Event struct { ID int `db:"id, primarykey, autoincrement"` CourseID int `db:"course_id"` Capacity int `db:"capacity"` HasWaitlist bool `db:"has_waitlist"` HasComments bool `db:"has_comments"` Title string `db:"title"` Annotation sql.NullString `db:"annotation"` EnrollmentKey sql.NullString `db:"enrollment_key"` Meetings Meetings `` //Fullness is the number of users that enrolled in this event Fullness int `` //Percentage is (Fullness * 100) / Capacity Percentage int `` //comments of enrolled users (if enabled) Comments []sql.NullString //used for enrollment EventStatus EventStatus EnrollOption EnrollOption EnrollMsg string }
Event is a model of the event table.
func (*Event) GetColumnValue ¶
GetColumnValue returns the value of a specific column.
func (*Event) NewBlank ¶
func (event *Event) NewBlank(conf *EditEMailConfig) (err error)
NewBlank creates a new blank event.
func (*Event) Update ¶
func (event *Event) Update(tx *sqlx.Tx, column string, value interface{}, conf *EditEMailConfig) (users EMailsData, err error)
Update the specified column in the event table.
func (*Event) UpdateComments ¶
func (event *Event) UpdateComments(option bool, v *revel.Validation) (err error)
UpdateComments of an event.
func (*Event) UpdateWaitlist ¶
func (event *Event) UpdateWaitlist(option bool, v *revel.Validation) (err error)
UpdateWaitlist of an event.
type EventStatus ¶
type EventStatus struct { Enrolled bool Full bool EnrollLimitReached bool //important to evaluate EnrollLimitEvents OnWaitlist bool InOtherEvent bool }
EventStatus validates the enrollment status of an user for a event.
type Events ¶
type Events []Event
Events holds all events of a course.
func (*Events) Get ¶
func (events *Events) Get(tx *sqlx.Tx, userID, courseID *int, manage bool, limit *sql.NullInt32) (err error)
Get all events of a course.
func (*Events) GetForValidation ¶
GetForValidation only returns event data required for course validation.
type Exception ¶
type Exception struct { ID int `db:"id"` CalendarEventID int `db:"calendar_event_id"` ExceptionStartDB time.Time `db:"exception_start"` ExceptionEndDB time.Time `db:"exception_end"` Annotation sql.NullString `db:"annotation"` //used to get the front end values ExceptionStart string `db:"exception_start_str"` ExceptionEnd string `db:"exception_end_str"` ExceptionStartTime string `` ExceptionEndTime string `` }
Exception can lock a timespan on a specific date.
func (*Exception) Insert ¶
func (except *Exception) Insert(tx *sqlx.Tx, v *revel.Validation) (users EMailsData, err error)
Insert an exception.
func (*Exception) Update ¶
func (except *Exception) Update(v *revel.Validation) (users EMailsData, err error)
Update an exception.
type Exceptions ¶
type Exceptions []Exception
Exceptions is a slice of exceptions.
type ExceptionsOfWeek ¶
type ExceptionsOfWeek []Exception
ExceptionsOfWeek holds all exeptions of a week [0....6].
type Group ¶
type Group struct { ID int `db:"id, primarykey, autoincrement"` ParentID sql.NullInt32 `db:"parent_id"` Name string `db:"name"` CourseLimit sql.NullInt32 `db:"course_limit"` LastEditor sql.NullInt32 `db:"last_editor"` LastEdited string `db:"last_edited"` Groups []Group `` //not a field in the respective table //used to ensure unique IDs if more than one group tree is present at a page IDPrefix string `` //identifies whether any parent/child has a course limit InheritsLimits bool `` ChildHasLimits bool `` //used to open courses CourseID int `db:"course_id"` }
Group is a model of the groups table. Groups are used to specify sections and subsections of an institution in which courses are placed.
type Groups ¶
type Groups []Group
Groups holds all groups in which courses can be placed. The struct is filled recursively by traversing the children of each group.
func (*Groups) SelectByUser ¶
SelectByUser selects all groups created by a user.
type HelpPageEntries ¶
type HelpPageEntries []HelpPageEntry
HelpPageEntries holds all entries of a specified help page.
type HelpPageEntry ¶
type HelpPageEntry struct { ID int `db:"id, primarykey, autoincrement"` CategoryID int `db:"category_id"` LastEditor sql.NullInt32 `db:"last_editor"` LastEdited string `db:"last_edited"` //determine the entry type IsFAQ bool //NewsFeed value Content string `db:"content"` //FAQ values Question string `db:"question"` Answer string `db:"answer"` }
HelpPageEntry is a model for either a FAQ or a news feed entry.
func (*HelpPageEntry) Delete ¶
func (entry *HelpPageEntry) Delete(table *string) (err error)
Delete an entry from either faq or news_feed.
func (*HelpPageEntry) Insert ¶
func (entry *HelpPageEntry) Insert(userID *int) (err error)
Insert a help page entry into either the faq or the news_feed table.
func (*HelpPageEntry) Update ¶
func (entry *HelpPageEntry) Update(userID *int) (err error)
Update a help page entry in either the faq or the news_feed table.
func (*HelpPageEntry) Validate ¶
func (entry *HelpPageEntry) Validate(v *revel.Validation)
Validate either FAQ or NewsFeed entry fields.
type IsTimestamp ¶
type IsTimestamp struct{}
IsTimestamp validates if a value can be parsed to a timestamp.
func (IsTimestamp) DefaultMessage ¶
func (v IsTimestamp) DefaultMessage() string
DefaultMessage returns the default message of IsTimestamp.
func (IsTimestamp) IsSatisfied ¶
func (v IsTimestamp) IsSatisfied(i interface{}) bool
IsSatisfied implements the validation result of IsTimestamp.
type LanguageValidator ¶
type LanguageValidator struct{}
LanguageValidator implements the validation of the selected language.
func (LanguageValidator) DefaultMessage ¶
func (v LanguageValidator) DefaultMessage() string
DefaultMessage returns the default message of LanguageValidator.
func (LanguageValidator) IsSatisfied ¶
func (v LanguageValidator) IsSatisfied(i interface{}) bool
IsSatisfied implements the validation result of LanguageValidator.
type ListConf ¶
type ListConf struct { //specify which users are downloaded/e-mailed AllEvents bool EventIDs []int Participants bool WaitList bool Unsubscribed bool //used for downloading the participants list UseComma bool Filename string //used for sending an e-mail Subject string Content string //used to specify a time interval for calendar events Start string End string StartTime string EndTime string }
ListConf determines to whom an e-mail is send or which users are at the downloaded participants list.
type LogEntries ¶
type LogEntries []LogEntry
LogEntries contains all relevant log entries.
func (*LogEntries) Insert ¶
func (entries *LogEntries) Insert() (err error)
Insert opens the log file and inserts all new log entries.
type LogEntry ¶
type LogEntry struct { ID int `db:"id, primarykey, autoincrement"` TimeOfCreation time.Time `db:"time_of_creation"` JSON string `db:"json"` Solved bool `db:"solved"` TimeOfCreationStr string `db:"time_of_creation_str"` }
LogEntry represents a line of the error log.
type Meeting ¶
type Meeting struct { ID int `db:"id, primarykey, autoincrement"` EventID int `db:"event_id"` MeetingInterval MeetingInterval `db:"meeting_interval"` WeekDay sql.NullInt32 `db:"weekday"` Place sql.NullString `db:"place"` Annotation sql.NullString `db:"annotation"` MeetingStart time.Time `db:"meeting_start"` MeetingEnd time.Time `db:"meeting_end"` //used to get the front end values MeetingStartTime string `` MeetingEndTime string `` //used for pretty timestamp rendering MeetingStartStr string `db:"meeting_start_str"` MeetingEndStr string `db:"meeting_end_str"` }
Meeting is a model of the meeting table.
func (*Meeting) Delete ¶
func (meeting *Meeting) Delete(conf *EditEMailConfig) (err error)
Delete a meeting.
func (*Meeting) Duplicate ¶
func (meeting *Meeting) Duplicate(conf *EditEMailConfig) (err error)
Duplicate a meeting.
func (*Meeting) NewBlank ¶
func (meeting *Meeting) NewBlank(conf *EditEMailConfig) (err error)
NewBlank creates a new blank meeting.
func (*Meeting) Update ¶
func (meeting *Meeting) Update(conf *EditEMailConfig) (err error)
Update a meeting.
func (*Meeting) Validate ¶
func (meeting *Meeting) Validate(v *revel.Validation)
Validate meeting fields.
type MeetingInterval ¶
type MeetingInterval int
MeetingInterval is a type for encoding different types of meetings.
const ( //SINGLE meetings happen once SINGLE MeetingInterval = iota //WEEKLY meetings happen every week WEEKLY //EVEN meetings happen in even weeks EVEN //ODD meetings happen in odd weeks ODD )
func (MeetingInterval) String ¶
func (interval MeetingInterval) String() string
type Meetings ¶
type Meetings []Meeting
Meetings holds all meetings of an event.
type NewCourseParam ¶
NewCourseParam holds all information about the different options to create a new course.
func (*NewCourseParam) Validate ¶
func (param *NewCourseParam) Validate(v *revel.Validation, course *Course)
Validate NewCourseParam fields.
type NoActiveChildren ¶
type NoActiveChildren struct{}
NoActiveChildren implements whether a group contains any subgroups or active courses.
func (NoActiveChildren) DefaultMessage ¶
func (noneActive NoActiveChildren) DefaultMessage() string
DefaultMessage returns the default message of NoActiveChildren.
func (NoActiveChildren) IsSatisfied ¶
func (noneActive NoActiveChildren) IsSatisfied(i interface{}) bool
IsSatisfied implements the validation result of NoActiveChildren.
type NotRequired ¶
type NotRequired struct{}
NotRequired implements the validation of fields that must not be set.
func (NotRequired) DefaultMessage ¶
func (v NotRequired) DefaultMessage() string
DefaultMessage returns the default message of NotRequired.
func (NotRequired) IsSatisfied ¶
func (v NotRequired) IsSatisfied(i interface{}) bool
IsSatisfied implements the validation result of NotRequired.
type NotUnique ¶
type NotUnique struct{}
NotUnique implements the validation of fields that must not be set.
func (NotUnique) DefaultMessage ¶
DefaultMessage returns the default message of NotUnique.
func (NotUnique) IsSatisfied ¶
IsSatisfied implements the validation result of NotUnique.
type NullAffiliations ¶
type NullAffiliations struct { Affiliations Affiliations Valid bool //Valid is true if Affiliations is not NULL }
NullAffiliations represents affiliations that may be null.
func (*NullAffiliations) Scan ¶
func (affiliations *NullAffiliations) Scan(value interface{}) error
Scan constructs NullAffiliations from a SQL Value.
type ParentHasCourseLimit ¶
type ParentHasCourseLimit struct{}
ParentHasCourseLimit implements whether any parent group has a course limit or not.
func (ParentHasCourseLimit) DefaultMessage ¶
func (courseLimit ParentHasCourseLimit) DefaultMessage() string
DefaultMessage returns the default message of ParentHasCourseLimit.
func (ParentHasCourseLimit) IsSatisfied ¶
func (courseLimit ParentHasCourseLimit) IsSatisfied(i interface{}) bool
IsSatisfied implements the validation result of ParentHasCourseLimit.
type ParticipantList ¶
type ParticipantList struct { //general event information Event //all participant lists of the event Participants Entries Waitlist Entries Unsubscribed Entries //additional calendar event information IsCalendarEvent bool `db:"is_calendar_event"` Monday time.Time Week int Year int //day templates for this week [0...6] Days Days //all slots of a calendar event Slots Slots }
ParticipantList of an event.
type Participants ¶
type Participants struct { ID int `db:"id, primarykey, autoincrement"` Title string `db:"title"` Active bool `db:"active"` EnrollmentStartStr string `db:"enrollment_start_str"` EnrollmentEndStr string `db:"enrollment_end_str"` UnsubscribeEndStr sql.NullString `db:"unsubscribe_end_str"` ExpirationDateStr string `db:"expiration_date_str"` ViewMatrNr bool `db:"view_matr_nr"` UserEMail string `db:"user_email"` Expired bool Lists ParticipantLists }
Participants of a course.
type Restriction ¶
type Restriction struct { ID int `db:"id, primarykey, autoincrement"` CourseID int `db:"course_id"` MinimumSemester sql.NullInt64 `db:"minimum_semester"` DegreeID sql.NullInt64 `db:"degree_id"` CourseOfStudiesID sql.NullInt64 `db:"courses_of_studies_id"` //for usability DegreeName sql.NullString `db:"degree_name"` StudiesName sql.NullString `db:"studies_name"` }
Restriction is a model of the restriction table.
func (*Restriction) Exists ¶
func (rest *Restriction) Exists(tx *sqlx.Tx) (exists bool, err error)
Exists returns if a restriction exists in the DB.
func (*Restriction) Insert ¶
func (rest *Restriction) Insert(tx *sqlx.Tx, courseID int) (err error)
Insert restriction.
func (*Restriction) Validate ¶
func (rest *Restriction) Validate(v *revel.Validation)
Validate Restriction fields.
type Restrictions ¶
type Restrictions []Restriction
Restrictions of a course.
func (*Restrictions) Duplicate ¶
func (rests *Restrictions) Duplicate(tx *sqlx.Tx, courseID, courseIDOld *int) (err error)
Duplicate all restrictions of a course.
func (*Restrictions) Get ¶
func (rests *Restrictions) Get(tx *sqlx.Tx, courseID *int) (err error)
Get all restrictions of a course.
func (*Restrictions) InsertUploaded ¶
func (rests *Restrictions) InsertUploaded(tx *sqlx.Tx, courseID int) (err error)
InsertUploaded restrictions of a course.
type Salutation ¶
type Salutation int
Salutation is a type for encoding different forms of address.
const ( //NONE is for no form of address NONE Salutation = iota //MR is for Mr. MR //MS is for Ms. MS )
func (Salutation) String ¶
func (s Salutation) String() string
type Schedule ¶
type Schedule struct { Date string Entries []ScheduleEntry InPast bool Today bool }
Schedule is a helper struct to display a day template at the front end.
type ScheduleEntry ¶
type ScheduleEntry struct { StartTime string EndTime string //should be the same as the subsequent start time Interval int Type ScheduleEntryType UserID string SlotID int }
ScheduleEntry containing all information to print a section of a day template.
type ScheduleEntryType ¶
type ScheduleEntryType int
ScheduleEntryType is a type for encoding different schedule entries.
const ( //FREE is for no entry FREE ScheduleEntryType = iota //SLOT is for slots SLOT //EXCEPTION is for exceptions EXCEPTION //BLOCKED is for Timeslots between BLOCKED )
func (ScheduleEntryType) String ¶
func (s ScheduleEntryType) String() string
type Slot ¶
type Slot struct { ID int `db:"id"` DayTmplID int `db:"day_tmpl_id"` UserID int `db:"user_id"` //date + time Start time.Time `db:"start_time"` End time.Time `db:"end_time"` //used for participants management User User StartStr string `db:"start_str"` EndStr string `db:"end_str"` }
Slot is a booked timespan on an specific date.
func (*Slot) BelongsToEvent ¶
BelongsToEvent checks if a slot belongs to an event
func (*Slot) Delete ¶
func (slot *Slot) Delete(v *revel.Validation) (data EMailData, err error)
Delete a slot if it it is more than an hour away.
func (*Slot) DeleteManual ¶
DeleteManual manually deletes a slot.
type Slots ¶
type Slots []Slot
Slots booked at a specific day within StartTime and EndTime of a day template.
func (*Slots) Get ¶
Get all slots of a day template. Monday specifies the week for which all slots must be loaded and weekday specifies the day.
func (*Slots) GetAllCalendarEvent ¶
GetAllCalendarEvent returns all slots of a calendar event.
type Study ¶
type Study struct { UserID int `db:"user_id, primarykey"` Semester int `db:"semester"` DegreeID int `db:"degree_id, primarykey"` CourseOfStudiesID int `db:"course_of_studies_id, primarykey"` Degree string `db:"degree"` //not a field in the studies table CourseOfStudies string `db:"course_of_studies"` //not a field in the studies table }
Study is a model of the studies table.
type Unique ¶
type Unique struct{}
Unique implements the validation of the uniqueness of a column value in a provided table.
func (Unique) DefaultMessage ¶
DefaultMessage returns the default message of Unique.
func (Unique) IsSatisfied ¶
IsSatisfied implements the validation result of Unique.
type Unsubscribed ¶
type Unsubscribed struct { UserID int `db:"user_id, primarykey"` EventID int `db:"event_id, primarykey"` }
Unsubscribed is a model of the unsubscribed table.
type User ¶
type User struct { ID int `db:"id, primarykey, autoincrement"` LastName string `db:"last_name"` FirstName string `db:"first_name"` EMail string `db:"email, unique"` Salutation Salutation `db:"salutation"` Role Role `db:"role"` LastLogin string `db:"last_login"` FirstLogin string `db:"first_login"` Language sql.NullString `db:"language"` //ldap user fields MatrNr sql.NullInt32 `db:"matr_nr, unique"` AcademicTitle sql.NullString `db:"academic_title"` Title sql.NullString `db:"title"` NameAffix sql.NullString `db:"name_affix"` Affiliations NullAffiliations `db:"affiliations"` Studies Studies `` //external user fields Password sql.NullString `db:"password"` PasswordRepeat string `` //not a field in the respective table ActivationCode sql.NullString `db:"activation_code"` //not a field in the resprective table IsEditor bool IsInstructor bool //used for event enrollment IsLDAP bool `db:"is_ldap"` //used for profile page ActiveEnrollments Enrollments ExpiredEnrollments Enrollments ActiveSlots Enrollments ExpiredSlots Enrollments }
User is a model of the users table.
func (*User) AuthorizedToEdit ¶
AuthorizedToEdit returns whether a user is authorized to edit a course or not.
func (*User) ChangeUserData ¶
func (user *User) ChangeUserData(v *revel.Validation) (err error)
ChangeUserData updates the salutation, first name, last name and e-mail of an user.
func (*User) GenerateNewPassword ¶
func (user *User) GenerateNewPassword(v *revel.Validation) (err error)
GenerateNewPassword for an user.
func (*User) GetBasicData ¶
GetBasicData returns basic information of an user.
func (*User) GetNavigationData ¶
GetNavigationData returns all information used for the navigation bar.
func (*User) GetProfileData ¶
GetProfileData returns all profile information of the user.
func (*User) HasElevatedRights ¶
HasElevatedRights returns whether a user is an instructor, editor, creator or admin (of a course).
func (*User) IsEditorInstructor ¶
IsEditorInstructor returns whether a user is an editor or instructor or not.
func (*User) NewActivationCode ¶
NewActivationCode creates a new activation code for an user.
func (*User) NewPassword ¶
func (user *User) NewPassword(newPw1, newPw2 string, v *revel.Validation) (err error)
NewPassword sets a new password for an user.
func (*User) Register ¶
func (user *User) Register(v *revel.Validation) (err error)
Register inserts an external user. It provides all session values of that user.
func (*User) SetPrefLanguage ¶
SetPrefLanguage sets the preferred language of an user.
func (*User) Validate ¶
func (user *User) Validate(tx *sqlx.Tx, v *revel.Validation)
Validate User fields when changing user data.
func (*User) ValidateRegister ¶
func (user *User) ValidateRegister(tx *sqlx.Tx, v *revel.Validation)
ValidateRegister User fields of newly registered users.
func (*User) VerifyActivationCode ¶
VerifyActivationCode verifies an activation code.
type UserDetails ¶
type UserDetails struct { User User //all groups created by this user Groups Groups //all (former) enrollments of the user Enrollments []Enrolled FormerEnrollments []Unsubscribed //all courses in which the user was directly involved CreatedCourses []Course EditorOf []Course InstructorOf []Course //all courses of which the user was on the allowlist/blocklist OnAllowlist []Course OnBlocklist []Course //all categories, faqs and news created by this user Categories []Category FAQs []HelpPageEntries News []HelpPageEntries }
UserDetails holds detailed data related to a user.
type UserList ¶
type UserList []UserListEntry
UserList holds users enlisted on one (or more) of the user lists.
func (*UserList) Duplicate ¶
func (users *UserList) Duplicate(tx *sqlx.Tx, courseIDNew, courseIDOld *int, table string) (err error)
Duplicate the user list of a course.
func (*UserList) GetEditorsInstructors ¶
GetEditorsInstructors returns editors and instructors.
func (*UserList) InsertUploaded ¶
InsertUploaded inserts all entries in a user list into a course. Skips all users with an invalid user ID.
type UserListEntry ¶
type UserListEntry struct { UserID int `db:"user_id, primarykey"` CourseID int `db:"course_id, primarykey"` ViewMatrNr bool `db:"view_matr_nr"` //only a field in the tables editor and instructor //identifies whether a user is already on a user list OnList bool `db:"on_list"` //used for showing users at user searches EMail string `db:"email, unique"` //used for showing users properly AcademicTitle sql.NullString `db:"academic_title"` Title sql.NullString `db:"title"` NameAffix sql.NullString `db:"name_affix"` LastName string `db:"last_name"` FirstName string `db:"first_name"` Salutation Salutation `db:"salutation"` ActivationCode sql.NullString `db:"activation_code"` }
UserListEntry is a model of the user list tables, which are: editors, instructors, blocklist, allowlist. It is also used to render users for the different user searches at the course management page.
func (*UserListEntry) Delete ¶
func (user *UserListEntry) Delete(table string) (active bool, data EMailData, err error)
Delete the provided user list entry of a course.
func (*UserListEntry) Exists ¶
func (user *UserListEntry) Exists(tx *sqlx.Tx) (exists bool, err error)
Exists returns if a user exists in the DB.
type Users ¶
type Users []User
Users holds specific users, such as only admins, creators, ...
func (*Users) AutoEnrollFromWaitList ¶
func (users *Users) AutoEnrollFromWaitList(tx *sqlx.Tx, eventID *int, status EnrollmentStatus) (err error)
AutoEnrollFromWaitList is a function that is triggered in many different situations: - A user unsubscribes from an event and now there is a free slot. - When increasing the course capacity. - When manually unsubscribing an user from an event.
type ValidateUniqueData ¶
ValidateUniqueData contains all data to validate the uniqueness of a column value in a table.
type Version2Course ¶
type Version2Course struct { CourseName string Subtitle string CourseLeader []Version2UserList Limitation []Version2Limitations EnrollmentStartDate string EnrollmentEndDate string EnrollmentStartTime string EnrollmentEndTime string DisenrollmentStartDate string DisenrollmentStartTime string ExpirationDate string ExpirationTime string Public string PaymentAmount string Description string Event []Version2Event Blacklist []Version2UserList Whitelist []Version2UserList Parent string Prioid int EnrollLimitEvents int WelcomeMail string }
Version2Course is the version 2 struct of a course.
func (*Version2Course) Transform ¶
func (version2Course *Version2Course) Transform(course *Course) (err error)
Transform a version 2 course struct to the current course struct.
type Version2Event ¶
type Version2Event struct { WaitingList string Description string MaximumParticipants string EnrollmentKey1 string EnrollmentKey2 string InitEnrollmentKey string Meeting []Version2Meeting }
Version2Event is the version 2 struct of an event.
type Version2Limitations ¶
type Version2Limitations struct { OnlyLDAP string Degree string CourseOfStudies string Semester string }
Version2Limitations is the version 2 struct used for course restrictions.
type Version2Meeting ¶
type Version2Meeting struct { MeetingRegularity string Day string WeeklyInterval string MeetingDate string MeetingStartTime string MeetingEndTime string Location string Annotation string }
Version2Meeting is the version 2 struct of a meeting.
func (*Version2Meeting) Transform ¶
func (version2Meeting *Version2Meeting) Transform(meeting *Meeting) (err error)
Transform a version 2 meeting struct to the current meeting struct.
type Version2UserList ¶
Version2UserList is the version 2 struct used for user lists.
type Version3Course ¶
Version3Course contains the Blacklist and Whitelist field for backwards compatibility.
func (*Version3Course) Transform ¶
func (version3Course *Version3Course) Transform(course *Course)
Transform a version 3 course struct to the current course struct.
Source Files
¶
- affiliations.go
- calendar_events.go
- calendar_exceptions.go
- const.go
- course.go
- courses.go
- creator.go
- credentials.go
- custom_time.go
- day_tmpls.go
- emails.go
- enrollment.go
- enums.go
- events.go
- groups.go
- help_pages.go
- init.go
- legacy.go
- log_entries.go
- meetings.go
- participants.go
- restrictions.go
- slots.go
- studies.go
- user.go
- user_details.go
- user_list.go
- users.go
- validators.go