api

package
v0.0.0-...-8b1dbc5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentQuery

type CommentQuery struct {
	RecipeID   string `form:"recipeId"`
	RecipeName string `form:"recipeName"`
	Limit      int    `form:"limit"`
	Offset     int    `form:"offset"`
}

type CommentResult

type CommentResult struct {
	ID           string    `json:"id"`
	Owner        Owner     `json:"owner"`
	CreatedAt    time.Time `json:"createdAt"`
	Text         string    `json:"text"`
	Helpful      bool      `json:"helpful"`
	HelpfulCount int       `json:"helpfulCount"`
	ParentID     string    `json:"parentId"`
	Children     any       `json:"children"`
}

type Comments

type Comments struct {
	Count         int             `json:"count"`
	Results       []CommentResult `json:"results"`
	MaxAge        int             `json:"maxAge"`
	SharedMaxAge  int             `json:"sharedMaxAge"`
	SurrogateKeys []string        `json:"surrogateKeys"`
}

type Ingredient

type Ingredient struct {
	ID           string  `json:"id"`
	Name         string  `json:"name"`
	Unit         string  `json:"unit"`
	UnitID       string  `json:"unitId"`
	Amount       float64 `json:"amount"`
	IsBasic      bool    `json:"isBasic"`
	UsageInfo    string  `json:"usageInfo"`
	URL          any     `json:"url"`
	FoodID       string  `json:"foodId"`
	ProductGroup string  `json:"productGroup"`
	BlsKey       string  `json:"blsKey"`
}

type IngredientGroup

type IngredientGroup struct {
	Header      string       `json:"header"`
	Ingredients []Ingredient `json:"ingredients"`
}

type Owner

type Owner struct {
	ID                     string `json:"id"`
	Username               string `json:"username"`
	Rank                   int    `json:"rank"`
	Role                   string `json:"role"`
	HasAvatar              bool   `json:"hasAvatar"`
	AvatarImageURLTemplate string `json:"avatarImageUrlTemplate"`
	HasPaid                bool   `json:"hasPaid"`
	Deleted                bool   `json:"deleted"`
}

type Rating

type Rating struct {
	Rating   float64 `json:"rating"`
	NumVotes int     `json:"numVotes"`
}

type Recipe

type Recipe struct {
	ID                      string            `json:"id"`
	Type                    int               `json:"type"`
	Title                   string            `json:"title" form:"title"`
	Subtitle                string            `json:"subtitle"`
	Owner                   Owner             `json:"owner"`
	Rating                  Rating            `json:"rating"`
	Difficulty              int               `json:"difficulty"`
	HasImage                bool              `json:"hasImage"`
	HasVideo                bool              `json:"hasVideo"`
	PreviewImageID          string            `json:"previewImageId"`
	PreviewImageOwner       Owner             `json:"previewImageOwner"`
	PreparationTime         int               `json:"preparationTime"`
	IsSubmitted             bool              `json:"isSubmitted"`
	IsRejected              bool              `json:"isRejected"`
	CreatedAt               time.Time         `json:"createdAt"`
	ImageCount              int               `json:"imageCount"`
	Editor                  Owner             `json:"editor"`
	SubmissionDate          time.Time         `json:"submissionDate"`
	IsPremium               bool              `json:"isPremium"`
	Status                  int               `json:"status"`
	Slug                    string            `json:"slug"`
	PreviewImageURLTemplate string            `json:"previewImageUrlTemplate"`
	IsPlus                  bool              `json:"isPlus"`
	Servings                int               `json:"servings"`
	KCalories               int               `json:"kCalories"`
	Nutrition               any               `json:"nutrition"`
	Instructions            string            `json:"instructions"`
	MiscellaneousText       string            `json:"miscellaneousText"`
	IngredientsText         string            `json:"ingredientsText"`
	Tags                    []string          `json:"tags"`
	FullTags                []Tag             `json:"fullTags"`
	ViewCount               int               `json:"viewCount"`
	CookingTime             int               `json:"cookingTime"`
	RestingTime             int               `json:"restingTime"`
	TotalTime               int               `json:"totalTime"`
	IngredientGroups        []IngredientGroup `json:"ingredientGroups"`
	CategoryIDs             []string          `json:"categoryIds"`
	RecipeVideoID           any               `json:"recipeVideoId"`
	IsIndexable             bool              `json:"isIndexable"`
	AffiliateContent        string            `json:"affiliateContent"`
	SiteURL                 string            `json:"siteUrl"`
}

type RecipeAPI

type RecipeAPI interface {
	Get(id string) (*Recipe, error)
	Comments(c CommentQuery) (*Comments, error)
	Search(s Search) (*RecipeSearch, error)
	Inspirations() (*RecipeInspirationsMixed, error)
}

type RecipeInspirations

type RecipeInspirations struct {
	Recipes []Recipe `json:"recipes"`
}

type RecipeInspirationsMixed

type RecipeInspirationsMixed struct {
	CookingRecipes []Recipe
	BakingRecipes  []Recipe
}

type RecipeSearch

type RecipeSearch struct {
	Count     int                  `json:"count"`
	QueryID   string               `json:"queryId"`
	Results   []RecipeSearchResult `json:"results"`
	TagGroups []TagGroup           `json:"tagGroups"`
}

type RecipeSearchResult

type RecipeSearchResult struct {
	Recipe Recipe `json:"recipe"`
	Score  int    `json:"score"`
}
type Search struct {
	Query  string `form:"query"`
	Limit  string `form:"limit"`
	Offset string `form:"offset"`
	Tags   string `form:"tags"`
}

type Tag

type Tag struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Count      int    `json:"count"`
	IsActive   bool   `json:"isActive"`
	IsDisabled bool   `json:"isDisabled"`
}

type TagGroup

type TagGroup struct {
	Key        string `json:"key"`
	Name       string `json:"name"`
	Icon       string `json:"icon"`
	IsActive   bool   `json:"isActive"`
	IsDisabled bool   `json:"isDisabled"`
	Tags       []Tag  `json:"tags"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳