menu

package
v0.0.0-...-a55ffd3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(db *sqlx.DB, id int) error

Delete menu

func GetCardOfMenu

func GetCardOfMenu(db *sqlx.DB, id int) (*card.Card, error)

GetCardOfMenu returns card which is assigned to the specific menu

func Update

func Update(db *sqlx.DB, id int, name string, cardID int, now time.Time) error

Update changes Menu object based on name Returns error if it was not found

func ValidateName

func ValidateName(text string) (b bool)

ValidateName checks if a name of a card is correct

Types

type Menu struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	CardID      int       `db:"card_id" json:"cardID"`
	DateCreated time.Time `db:"created" json:"dateCreated"`
	DateUpdated time.Time `db:"updated" json:"dateUpdated"`
}

Menu holds Name and wired card.

func Add

func Add(db *sqlx.DB, name string, cardID int, now time.Time) (*Menu, error)

Add appends new Menu object

func Find

func Find(db *sqlx.DB, name string) (*Menu, error)

Find returns menu object based on name

func Get

func Get(db *sqlx.DB, id int) (*Menu, error)

Get menu

func GetAll

func GetAll(db *sqlx.DB) ([]Menu, error)

GetAll returns all menus

Jump to

Keyboard shortcuts

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