Documentation ¶
Index ¶
- func Create(w http.ResponseWriter, r *http.Request)
- func CreateProcess(w http.ResponseWriter, r *http.Request)
- func DeleteBook(r *http.Request) error
- func DeleteProcess(w http.ResponseWriter, r *http.Request)
- func Index(w http.ResponseWriter, r *http.Request)
- func Show(w http.ResponseWriter, r *http.Request)
- func ShowJSON(w http.ResponseWriter, r *http.Request)
- func Update(w http.ResponseWriter, r *http.Request)
- func UpdateProcess(w http.ResponseWriter, r *http.Request)
- type Book
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProcess ¶
func CreateProcess(w http.ResponseWriter, r *http.Request)
CreateProcess API end point for creation
func DeleteProcess ¶
func DeleteProcess(w http.ResponseWriter, r *http.Request)
DeleteProcess API entry to so delete a book
func Show ¶
func Show(w http.ResponseWriter, r *http.Request)
Show generally shows one particular book but needs a parameter in get
func ShowJSON ¶
func ShowJSON(w http.ResponseWriter, r *http.Request)
ShowJSON gets all the data one time and shows the in JSON format
func Update ¶
func Update(w http.ResponseWriter, r *http.Request)
Update shows the last book that was updated
func UpdateProcess ¶
func UpdateProcess(w http.ResponseWriter, r *http.Request)
UpdateProcess API endpoint for editing the book entry
Types ¶
type Book ¶
type Book struct { // ID bson.ObjectId `json:"id" bson:"_id"` Isbn string `json:"isbn" bson:"isbn"` Title string `json:"title" bson:"title"` Author string `json:"author" bson:"author"` Price float32 `json:"price" bson:"price"` }
Book data
Click to show internal directories.
Click to hide internal directories.