Documentation
¶
Index ¶
Constants ¶
View Source
const ( UserTokenLength = 16 MaxUserNameLength = 32 )
View Source
const GlobalUsername = "default"
View Source
const MaxPizzaNameLength = 64
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassicalName ¶
type Ingredient ¶
type Pizza ¶
type Pizza struct {
ID int64 `json:"id" bun:",pk,autoincrement"`
CreatedAt time.Time `json:"-" bun:",nullzero,notnull,default:current_timestamp"`
Name string `json:"name"`
DoughID int64 `json:"-"`
Dough Dough `json:"dough" bun:"rel:belongs-to,join:dough_id=id"`
Ingredients []Ingredient `json:"ingredients" bun:"m2m:pizza_to_ingredients,join:Pizza=Ingredient"`
Tool string `json:"tool"`
}
func (Pizza) CalculateCalories ¶
func (Pizza) IsVegetarian ¶
type PizzaToIngredients ¶
type PizzaToIngredients struct {
PizzaID int64 `bun:",pk"`
Pizza *Pizza `bun:"rel:belongs-to,join:pizza_id=id"`
IngredientID int64 `bun:",pk"`
Ingredient *Ingredient `bun:"rel:belongs-to,join:ingredient_id=id"`
}
type Rating ¶ added in v0.13.3
type User ¶ added in v0.13.3
type User struct {
bun.BaseModel
ID int64 `json:"id" bun:",pk,autoincrement"`
Username string `json:"username" bun:",unique"`
Token string `json:"token,omitempty" bun:",unique"`
Password string `json:"password,omitempty" bun:"-"` // Only used for JSON
PasswordHash string `json:"-"`
PasswordPlaintext string `json:"-"` // Only used for users created via testdata.yaml
}
Click to show internal directories.
Click to hide internal directories.