generator

package module
v0.0.0-...-652d564 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CategorieLocation = "/categories"
View Source
const IngredientLocation = "/ingredients"
View Source
const TypeScriptImageDir string = "images"
View Source
const TypeScriptModuleTemplate string = `` /* 279-byte string literal not displayed */
View Source
const TypeScriptTemplate string = `` /* 1783-byte string literal not displayed */

Variables

View Source
var ErrInvalidLanguage = errors.New("invalid language")
View Source
var ErrNoImageFound error = errors.New("No image found for related element")

Functions

func Generate

func Generate(database *FoodDB, language string, outputDir string) error

Types

type Category

type Category struct {
	Name      map[string]string `yaml:"name"`
	ImagePath string
}

type FoodDB

type FoodDB struct {
	Categories  map[string]Category
	Ingredients map[string]Ingredient
}

func LoadDatabase

func LoadDatabase(location string) (*FoodDB, error)

type Ingredient

type Ingredient struct {
	Name       map[string]string `yaml:"name"`
	Categories []string          `yaml:"categories"`
	Units      []string          `yaml:"units"`
	ImagePath  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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