Documentation ¶
Index ¶
- Constants
- func GenToken(sz int) string
- func StepName(step int64) (string, string)
- type Brew
- type DB
- func (db *DB) ActivateUser(token string) error
- func (db *DB) AddBrew(b *Brew) (int64, error)
- func (db *DB) AddIngredient(i *Ingredient) error
- func (db *DB) AddRecipe(r *Recipe) (int64, error)
- func (db *DB) AddUser(name, password, token string, verification bool) error
- func (db *DB) DeleteBrew(b *Brew) error
- func (db *DB) DeleteIngredient(i *Ingredient) error
- func (db *DB) DeleteRecipe(r *Recipe) error
- func (db *DB) DeleteUser(u *User) error
- func (db *DB) GetBrew(id int64) (*Brew, error)
- func (db *DB) GetIngredient(id int64) (*Ingredient, error)
- func (db *DB) GetRecipe(id int64) (*Recipe, error)
- func (db *DB) GetUserBrews(uid int64) ([]*Brew, error)
- func (db *DB) GetUserByEmail(email string) (*User, error)
- func (db *DB) GetUserById(uid int64) (*User, error)
- func (db *DB) GetUserIngredients(uid int64) ([]*Ingredient, error)
- func (db *DB) GetUserRecipes(uid int64) ([]*Recipe, error)
- func (db *DB) HashPassword(user, password string) (string, error)
- func (db *DB) LoadKey(name string, length int) []byte
- func (db *DB) UpdateBrew(b *Brew) error
- func (db *DB) UpdateIngredient(i *Ingredient) error
- func (db *DB) UpdateRecipe(r *Recipe) error
- func (db *DB) UpdateUser(u *User) error
- type Ingredient
- type Recipe
- type User
Constants ¶
View Source
const ( StepPrepare = iota StepMash StepBoil StepFermentation StepBottle StepDone StepMax = StepDone )
Brew steps.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Brew ¶
type Brew struct { Id int64 RecipeId int64 UserId int64 Step int64 File string XML *beerxml.Recipe }
Represents a brew.
type DB ¶
func (*DB) ActivateUser ¶
Activate an user based on a provided token.
func (*DB) DeleteIngredient ¶
func (db *DB) DeleteIngredient(i *Ingredient) error
Delete an ingredient.
func (*DB) GetIngredient ¶
func (db *DB) GetIngredient(id int64) (*Ingredient, error)
Retrieve a single ingredient given its id.
func (*DB) GetUserBrews ¶
Retrieve all brews for a given user.
func (*DB) GetUserByEmail ¶
Retrieves an user information from the db, given an email.
func (*DB) GetUserById ¶
Retrieves an user information from the db, given an uid.
func (*DB) GetUserIngredients ¶
func (db *DB) GetUserIngredients(uid int64) ([]*Ingredient, error)
Retrieve the ingredients for a given user.
func (*DB) GetUserRecipes ¶
Retrieves all recipes for a given user.
func (*DB) HashPassword ¶
Hashes a plaintext password.
func (*DB) UpdateIngredient ¶
func (db *DB) UpdateIngredient(i *Ingredient) error
Update an ingredient.
type Ingredient ¶
type Ingredient struct { Id int64 UserId int64 Name string Type string Link string File string XML interface{} }
Represents an ingredient (fermentable, hops, yeats, ...) in an user inventory and contains a path to its associated BeerXML file.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.