Documentation ¶
Index ¶
- func CreateUser(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
- func GetUser(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
- func GetUsers(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
- func Logout(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
- func SignIn(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
- func UpdateUser(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUser ¶
func CreateUser(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
func GetUser ¶
func GetUser(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
GetUser retrieves a user by username
func GetUsers ¶
func GetUsers(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
GetUsers retrieves all users from the MongoDB collection
func Logout ¶
func Logout(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
Empty function to match partern company specs. Client will need to delete JWT.
func SignIn ¶
func SignIn(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
SignIn: Does Sign In process, and returns jwt token and user role
func UpdateUser ¶
func UpdateUser(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)
UpdateUser handles updating an existing user
Types ¶
type User ¶
type User struct { Username string `json:"username" bson:"username"` Email string `json:"email" bson:"email"` Password string `json:"password" bson:"password"` Name string `json:"name" bson:"name"` IsAdmin bool `json:"-" bson:"isAdmin"` Peng bool `json:"peng" bson:"peng"` Pref_approved bool `json:"pref_approved" bson:"pref_approved"` Max_courses int `json:"max_courses" bson:"max_courses"` Course_pref []string `json:"course_pref" bson:"course_pref"` Time_pref map[string][][]string `json:"time_pref" bson:"time_pref"` Available map[string][][]string `json:"available" bson:"available"` }
User represents a user entity
Click to show internal directories.
Click to hide internal directories.