lib

package
v0.0.0-...-3410984 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintRecipes

func PrintRecipes(recipes []Recipe)

Types

type Ingredient

type Ingredient struct {
	Name   string `yaml:"Name"`
	Amount string `yaml:"Amount,omitempty"`
}

type Recipe

type Recipe struct {
	Name        string       `yaml:"Name"`
	Ingredients []Ingredient `yaml:"Ingredients"`
	MealTypes   []string     `yaml:"MealTypes"`
}

func GetRecipes

func GetRecipes() []Recipe

GetRecipes is a simple wrapper func in case I ever change to a database backend in the future

func PickRandomRecipe

func PickRandomRecipe(recipes []Recipe) Recipe

func PickRecipeByIngredient

func PickRecipeByIngredient(recipes []Recipe, ingredientsQuery []string) Recipe

PickRecipeByIngredient does assume that ingredientQuery is not a blank string

func (Recipe) PrintRecipe

func (recipe Recipe) PrintRecipe()

Jump to

Keyboard shortcuts

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