models

package
v0.0.0-...-0dd24be Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ingredient

type Ingredient struct {
	Amount float32 `json:"amount" bson:"a" `
	Unit   string  `json:"unit" bson:"u"`
	Name   string  `json:"name" bson:"n"`
}

type IngredientGroup

type IngredientGroup struct {
	Title       string       `json:"title" bson:"r"`
	Ingredients []Ingredient `json:"ingredients" bson:"i"`
}

type Ingredients

type Ingredients []Ingredient

type Recepies

type Recepies []Recipe

func (*Recepies) List

func (r *Recepies) List(c *mgo.Collection) error

type Recipe

type Recipe struct {
	Id          bson.ObjectId     `json:"id" bson:"_id"`
	Title       string            `json:"title" bson:"t"`
	Description string            `json:"description" bson:"d"`
	Url         string            `json:"url" bson:"u"`
	Ingredients []IngredientGroup `json:"ingredients" bson:"j"`
	Image       string            `json:"image" bson:"m"`
}

func (*Recipe) Delete

func (r *Recipe) Delete(c *mgo.Collection) error

func (*Recipe) Find

func (r *Recipe) Find(id bson.ObjectId, c *mgo.Collection) error

func (*Recipe) FromJson

func (r *Recipe) FromJson(reader io.Reader) error

func (*Recipe) Insert

func (r *Recipe) Insert(c *mgo.Collection) error

func (Recipe) ToJson

func (r Recipe) ToJson() ([]byte, error)

func (*Recipe) Update

func (r *Recipe) Update(c *mgo.Collection) error

Jump to

Keyboard shortcuts

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