Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSectionToClass ¶
func AddSectionToClass(cid primitive.ObjectID, section SectionWithName)
func AddUserToSection ¶
func AddUserToSection(user User)
func CheckAdminAccount ¶
func CheckAdminAccount()
Types ¶
type Class ¶
type Class struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` Name string `json:"class_name" bson:"class_name" validate:"required,min=3,max=32"` Sections []SectionWithName `json:"sections,omitempty" bson:"sections,omitempty"` // Sections []SectionWithName `json:"sections" bson:"sections"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
func CreateClass ¶
func GetClasses ¶
type ClassSection ¶
type ClassSection struct { ClassName string `json:"class_name" bson:"class_name"` SectionName string `json:"section_name" bson:"section_name"` ClassID primitive.ObjectID `json:"class_id" bson:"class_id" validate:"required"` SectionID primitive.ObjectID `json:"section_id" bson:"section_id" validate:"required"` }
type OnlineRoom ¶
type OnlineRoom struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` Name string `json:"room_name" bson:"room_name" validate:"required,min=1,max=32"` ClassLive bool `json:"class_live" bson:"class_live"` VirtualClass primitive.ObjectID `json:"virtualclass,omitempty" bson:"virtualclass,omitempty"` CurrentTeacher []primitive.ObjectID `json:"teachers,omitempty" bson:"teachers,omitempty"` StudentsJoined []primitive.ObjectID `json:"students,omitempty" bson:"students,omitempty"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
this is an instance of an online class, one document per section of a class.
func CreateRoom ¶
func CreateRoom(name string) (OnlineRoom, error)
func GetRoom ¶
func GetRoom(key, value string) (OnlineRoom, error)
type Section ¶
type Section struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` Name string `json:"section_name" bson:"section_name" validate:"required,min=1,max=32"` Students []primitive.ObjectID `json:"students,omitempty" bson:"students,omitempty"` Teachers []primitive.ObjectID `json:"teachers,omitempty" bson:"teachers,omitempty"` OnlineRoom primitive.ObjectID `json:"online_room,omitempty" bson:"online_room,omitempty"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
func CreateSection ¶
func GetSection ¶
type SectionWithName ¶
type User ¶
type User struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` Name string `json:"name" bson:"name" validate:"required,min=3,max=32"` UserID string `json:"user_id" bson:"user_id" validate:"required,min=3,max=32"` Password string `json:"password,omitempty" bson:"password,omitempty"` Roles []string `json:"roles" bson:"roles" validate:"validRoles"` Experience string `json:"experience,omitempty" bson:"experience,omitempty"` Expertise string `json:"expertise,omitempty" bson:"expertise,omitempty"` BelongsTo ClassSection `json:"belongs_to" bson:"belongs_to" validate:"required"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
func CreateUser ¶
func GetUsers ¶
func GetUsers(filters UserFilters) ([]User, error)
type UserFilters ¶
type UserFilters struct {
Role string
}
Click to show internal directories.
Click to hide internal directories.