Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { ID objectid.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` Author string `bson:"author" json:"author"` Genre string `bson:"genre" json:"genre"` NumberOfPages int64 `bson:"number_of_pages" json:"number_of_pages"` YearOfPublication int64 `bson:"publication_year" json:"publication_year"` Rating int64 `bson:"rating" json:"rating"` }
Book book model structure
type BookFilter ¶
type BookFilter struct { ID objectid.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` Author string `bson:"author" json:"author"` Genre string `bson:"genre" json:"genre"` NumberOfPages int64 `bson:"number_of_pages" json:"number_of_pages"` YearOfPublication int64 `bson:"publication_year" json:"publication_year"` Rating int64 `bson:"rating" json:"rating"` }
BookFilter book filter model structure
type BookRequest ¶
type BookRequest struct { *Book ProtectedID string `json:"_id"` // override '_id' json to have more control }
BookRequest small hack to protect ID of being posted and update from body payload
Click to show internal directories.
Click to hide internal directories.