Design a basic web API for user which performs CURD (Create, Update, Read and Delete) operations. Libraries used for building API are GoFiber and MongoDB.
GET /users
- Get all usersGET /users/{id}
- Get user by idPOST /users
- Create a new userPUT /users/{id}
- Update user by idDELETE /users/{id}
- Delete user by id
type User struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
Name string `json:"name" bson:"name"`
Title string `json:"title" bson:"title"`
}