recipes

package
v0.0.0-...-7d38a10 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRecipe

func CreateRecipe(createRecipe createRecipe) *api.Endpoint

func GetRecipe

func GetRecipe(getRecipe getRecipe, getIngredientsForRecipe getIngredientsForRecipe, getStepsForRecipe getStepsForRecipe) *api.Endpoint

func ListRecipes

func ListRecipes(listRecipes listRecipes) *api.Endpoint

Types

type ByIngredientNumber

type ByIngredientNumber []*repositories.Ingredient

func (ByIngredientNumber) Len

func (a ByIngredientNumber) Len() int

func (ByIngredientNumber) Less

func (a ByIngredientNumber) Less(i, j int) bool

func (ByIngredientNumber) Swap

func (a ByIngredientNumber) Swap(i, j int)

type ByStepNumber

type ByStepNumber []*repositories.Step

func (ByStepNumber) Len

func (a ByStepNumber) Len() int

func (ByStepNumber) Less

func (a ByStepNumber) Less(i, j int) bool

func (ByStepNumber) Swap

func (a ByStepNumber) Swap(i, j int)

type CreateRecipeRequest

type CreateRecipeRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Servings    int    `json:"servings"`
	PrepTime    string `json:"prep_time"`
	CookTime    string `json:"cook_time"`
	CoolTime    string `json:"cool_time"`
	TotalTime   string `json:"total_time"`
	Source      string `json:"source"`
}

func (*CreateRecipeRequest) Validate

func (a *CreateRecipeRequest) Validate() map[string]string

type CreateRecipeResponse

type CreateRecipeResponse struct {
	RecipeID int64             `json:"recipe_id,omitempty"`
	Errors   map[string]string `json:"errors,omitempty"`
}

type RecipeListResponse

type RecipeListResponse struct {
	Recipes []*repositories.Recipe `json:"recipes"`
}

type RecipeResponse

type RecipeResponse struct {
	repositories.Recipe
	Ingredients []*repositories.Ingredient `json:"ingredients"`
	Steps       []*repositories.Step       `json:"steps"`
}

Jump to

Keyboard shortcuts

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