models

package
v0.0.0-...-66f614f Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDatabase

func ConnectDatabase()

Types

type Hop

type Hop struct {
	gorm.Model
	// ID does not match do db primary key!
	ID     int    `json:"id" gorm:"primary_key"`
	Name   string `json:"name" binding:"required"`
	Iso    string `json:"iso" binding:"required"`
	Amount int    `json:"amount" binding:"required"`
}

type Malt

type Malt struct {
	gorm.Model
	ID     int    `json:"id" gorm:"primary_key"`
	Name   string `json:"name"`
	EBC    string `json:"EBC"`
	Amount int    `json:"amount"`
}

type Mashstep

type Mashstep struct {
	ID          int `json:"id"`
	Time        int `json:"time"`
	Temperature int `json:"temperature"`
}

func GetMashstep

func GetMashstep() Mashstep

func GetMashsteps

func GetMashsteps() []Mashstep

type Recipe

type Recipe struct {
	Id               int
	Title            string  `json:"title"`
	BasicInfo        string  `json:"basic_info"`
	HopInfo          string  `json:"hop_info"`
	MaltInfo         string  `json:"malt_info"`
	MashInfo         string  `json:"mash_info"`
	FermentationInfo string  `json:"fermentation_info"`
	IBU              float64 `json:"ibu"`
	EBC              float64 `json:"ebc"`
	OGTarget         float64 `json:"og_target"` // specifies the targeted original gravity in %sacc
	CastWorth        float64 `json:"cast_worth"`
	CookingTime      float64 `json:"cooking_time"`
	SHA              float64 `json:"sha"`
}

func GetRecipe

func GetRecipe() Recipe

func GetRecipes

func GetRecipes() []Recipe

type RecipeMaltRelation

type RecipeMaltRelation struct {
	ID       int    `json:"id"`
	RecipeID string `json:"title"`
	EBC      string `json:"EBC"`
	Amount   int    `json:"amount"`
}

func GetRecipeMaltRelation

func GetRecipeMaltRelation() RecipeMaltRelation

func GetRecipeMaltRelations

func GetRecipeMaltRelations() []RecipeMaltRelation

type Resource

type Resource interface {
	Hop | Malt | Yeast
}

type Yeast

type Yeast struct {
	gorm.Model
	ID      int     `json:"id" gorm:"primary_key"`
	Name    string  `json:"name"`
	MinTemp float64 `json:"minTemp"`
	MaxTemp float64 `json:"maxTemp"`
	Top     string  `json:"top"`
}

Jump to

Keyboard shortcuts

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