Documentation ¶
Index ¶
- func Create(iEnv *config.Data) httprouter.Handle
- func CreateData(cl *mongo.Collection, i Item) primitive.ObjectID
- func Delete(iEnv *config.Data) httprouter.Handle
- func DeleteData(cl *mongo.Collection, id primitive.ObjectID) int64
- func Edit(iEnv *config.Data) httprouter.Handle
- func Get(iEnv *config.Data) httprouter.Handle
- func Index(iEnv *config.Data) httprouter.Handle
- func ModifyData(cl *mongo.Collection, i []Item) primitive.ObjectID
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateData ¶
func CreateData(cl *mongo.Collection, i Item) primitive.ObjectID
CreateData creates a item and returns the create item
func DeleteData ¶
func DeleteData(cl *mongo.Collection, id primitive.ObjectID) int64
DeleteData deletes the item of given id
func ModifyData ¶
func ModifyData(cl *mongo.Collection, i []Item) primitive.ObjectID
ModifyData replace the item given on pos 0 from slice by the item on pos 1
Types ¶
type Item ¶
type Item struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty"` Price int8 `json:"price,omitempty" bson:"price,omitempty"` Visible bool `json:"visible,omitempty" bson:"visible,omitempty"` }
Item describe a basic menu item struct
Click to show internal directories.
Click to hide internal directories.