Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDocExistsAlready is thrown if document is already found ErrDocExistsAlready = errors.New("Document already exists") // ErrScheduleNotFound is thrown if schedule is not found ErrScheduleNotFound = errors.New("Schedule not found") // ErrAlreadyInGroup is returned if someone is already in a group ErrAlreadyInGroup = errors.New("User already in this group") // ErrGroupsNotFound is thrown if there are no groups found ErrGroupsNotFound = errors.New("There were no groups in this season") )
Functions ¶
func DeleteSeason ¶
func DeleteSeason(ID string)
DeleteSeason removes season from database, it also should remove all schedules associated with it
func RemoveSchedule ¶
func RemoveSchedule(scheduleID string)
RemoveSchedule deletes the specified schedule from database
Types ¶
type Course ¶
type Course struct { Name string Number int NameShort string Description string CourseSubject Subject CourseID string }
Course represents a single course that the user can pick
func LoadCourses ¶
LoadCourses loads the course data from the database
type Group ¶
type Group struct { CourseID string Name string Position int8 Teacher string Students []string GroupID string SeasonID string }
Group reprsents a group of students that has a subject
func GetGroupsForCourse ¶
GetGroupsForCourse gets all groups for specific course
func GetGroupsInSeason ¶
GetGroupsInSeason returns a slice of all the groups that are in defined season
func (*Group) AddStudent ¶
AddStudent adds a new user to the group and saves change to database
type Schedule ¶
Schedule represents some users schedule
func AddSchedule ¶
AddSchedule creates an schedule for user in season and saves it to database
func GetSchedule ¶
GetSchedule gets schedule by id
func GetScheduleForUser ¶
GetScheduleForUser gets the schedule of an user in specific season
type Season ¶
Season represents one season of school where the schedule stays same
func GetSeasons ¶
type Subject ¶
Subject represents a single subject
func AddSubject ¶
AddSubject adds a new subject to the database of subjects
func GetSubject ¶
GetSubject gets data for specific subject in the database
func LoadSubjects ¶
LoadSubjects Gets all subjects from database