Documentation ¶
Index ¶
- func Create(env *config.Env) httprouter.Handle
- func CreateUser(cl *mongo.Collection, u User) primitive.ObjectID
- func Delete(env *config.Env) httprouter.Handle
- func DeleteUser(cl *mongo.Collection, id primitive.ObjectID) int64
- func Get(env *config.Env) httprouter.Handle
- func Index(env *config.Env) httprouter.Handle
- func Modify(env *config.Env) httprouter.Handle
- func ModifyUser(cl *mongo.Collection, u []User) primitive.ObjectID
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUser ¶
func CreateUser(cl *mongo.Collection, u User) primitive.ObjectID
CreateUser creates a user and returns the create user
func DeleteUser ¶
func DeleteUser(cl *mongo.Collection, id primitive.ObjectID) int64
DeleteUser deletes the user of given id
func ModifyUser ¶
func ModifyUser(cl *mongo.Collection, u []User) primitive.ObjectID
ModifyUser replace the user given on pos 0 from slice by the user on pos 1
Types ¶
type User ¶
type User struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` FName string `json:"fname,omitempty" bson:"fname,omitempty"` LName string `json:"lname,omitempty" bson:"lname,omitempty"` Email string `json:"email,omitempty" bson:"email,omitempty"` }
User basic structure
Click to show internal directories.
Click to hide internal directories.