menus

package
v0.0.0-...-cda5c7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(mEnv *config.Data) httprouter.Handle

Create handler to create a new menu

func CreateData

func CreateData(cl *mongo.Collection, m Menu) primitive.ObjectID

CreateData creates a item and returns the create item

func Delete

func Delete(mEnv *config.Data) httprouter.Handle

Delete handler to delete a menu

func DeleteData

func DeleteData(cl *mongo.Collection, id primitive.ObjectID) int64

DeleteData deletes the item of given id

func Edit

func Edit(mEnv *config.Data) httprouter.Handle

Edit handler to edit a existing menu

func Get

func Get(mEnv *config.Data) httprouter.Handle

Get handler to get a especific menu

func Index

func Index(mEnv *config.Data) httprouter.Handle

Index handler to show all menus

func ModifyData

func ModifyData(cl *mongo.Collection, m []Menu) primitive.ObjectID

ModifyData replace the item given on pos 0 from slice by the item on pos 1

Types

type Menu struct {
	ID       primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	Category string             `json:"category,omitempty" bson:"category,omitempty"`
	Items    []items.Item       `json:"items,omitempty" bson:"items,omitempty"`
}

Menu represents a menu struct

func AllData

func AllData(cl *mongo.Collection) []Menu

AllData returns a slice of Users

func OneData

func OneData(cl *mongo.Collection, id primitive.ObjectID) Menu

OneData returns the item from a ObjectID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL