Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth0Config ¶
type Category ¶
type Category struct { gorm.Model CategoryName string `gorm:"not null;unique" json:"CategoryName" example:"desserts"` }
Category struct to hold category data
type Config ¶
type Config struct { Global GlobalConfig Cors CorsConfig Auth0 Auth0Config Database DatabaseConfig S3 S3Config DatabaseClient *gorm.DB S3ClientSession *s3.S3 }
type CorsConfig ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Host string Username string Password string Database string Port int SSLMode string Timezone string }
DatabaseConfig holds database configuration items
type GlobalConfig ¶
type GlobalConfig struct {
Debug bool
}
GlobalConfig holds global configuration items
type Ingredient ¶
type Ingredient struct { gorm.Model IngredientName string `gorm:"unique; not null" json:"IngredientName" example:"apple"` }
Ingredient struct to hold ingredient data
type Instruction ¶
type Instruction struct { gorm.Model RecipeID uint `json:"RecipeID" example:"1"` Recipe Recipe `gorm:"references:ID" json:"-"` // StepNumber int `json:"StepNumber" example:"1"` // TODO introduce later Description string `gorm:"size:65535" json:"Description" example:"lorem ipsum dolor sit amet"` }
Instruction struct to hold instruction data
type Recipe ¶
type Recipe struct { gorm.Model RecipeName string `gorm:"not null" json:"RecipeName" example:"apple pie"` Description string `gorm:"size:65535;not null" json:"Description" example:"pie with apples"` DifficultyLevel int `gorm:"not null" json:"DifficultyLevel" example:"1"` CookingTime int `gorm:"default:0" json:"CookTime" example:"23"` ServingCount int `gorm:"default:0" json:"ServingCount" example:"4"` Ingredient []Ingredient `gorm:"many2many:recipe_ingredient;" json:"Ingredients"` Category []Category `gorm:"many2many:recipe_category;" json:"Categories"` Tags []Tag `gorm:"many2many:recipe_tag;" json:"Tags"` ImageName string `json:"ImageName" example:"123e4567-e89b-12d3-a456-426614174000"` AuthorID string `json:"Author" example:"123e4567-e89b-12d3-a456-426614174000"` Author Author `gorm:"references:UserID" json:"-"` }
Recipe struct to hold recipe data
type RecipeIngredient ¶
type RecipeIngredient struct { RecipeID int `gorm:"primaryKey" json:"RecipeID" example:"1"` IngredientID int `gorm:"primaryKey" json:"IngredientID" example:"1"` Quantity int `json:"Quantity" example:"40"` UnitID int `json:"UnitID" example:"1"` Unit Unit `gorm:"references:ID"` }
RecipeIngredient struct to hold recipe ingredient data
type Tag ¶
type Tag struct { gorm.Model TagName string `gorm:"not null;unique" json:"TagName" example:"pies"` }
Tag struct to hold tag data
Click to show internal directories.
Click to hide internal directories.