schema

package
v0.0.0-...-3cbc7d6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecipeSchemaURL               = "http://schema.org/Recipe"
	NutritionInformationSchemaURL = "http://schema.org/NutritionInformation"
)

Variables

View Source
var (
	ErrMissingItemScope = errors.New("Couldn't find itemscope attribute on node")
	ErrMissingItemType  = errors.New("Couldn't find itemtype attribute on node")
	ErrWrongItemType    = errors.New("Wrong itemtype attribute value")
)

Functions

This section is empty.

Types

type CreativeWork

type CreativeWork struct {
	Thing
	Author        string    `json:"author"`
	DatePublished time.Time `json:"datePublished"`
}

type NutritionInformation

type NutritionInformation struct {
	Calories   string `json:"calories"`
	FatContent string `json:"fatContent"`
}

NutritionInformation for a recipe.

func ParseNutritionInformation

func ParseNutritionInformation(sel *goquery.Selection) (*NutritionInformation, error)

type Recipe

type Recipe struct {
	CreativeWork
	CookTime      time.Time             `json:"cookTime"`
	CookingMethod string                `json:"cookingMethod"`
	Nutrition     *NutritionInformation `json:"nutrition"`
	PrepTime      time.Time             `json:"prepTime"`
	Category      string                `json:"recipeCategory"`
	Cuisine       string                `json:"recipeCuisine"`
	Ingredients   []string              `json:"recipeIngredient"`
	Instructions  string                `json:"recipeInstructions"`
	Yield         string                `json:"recipeYield"`
	TotalTime     time.Time             `json:"totalTime"`
}

Recipe for cooking.

func ParseRecipe

func ParseRecipe(sel *goquery.Selection) (*Recipe, error)

func ParseRecipes

func ParseRecipes(doc *goquery.Document) ([]*Recipe, error)

type Thing

type Thing struct {
	Image       string `json:"image"`
	Description string `json:"description"`
	Name        string `json:"name"`
}

Jump to

Keyboard shortcuts

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