repository

package
v0.0.0-...-07d1ea4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DbIngredient   *gorm.DB
	DbDenomination *gorm.DB
	DbDrinks       *gorm.DB
)
View Source
var (
	MachineInitialized bool = false
)

Functions

func ActivateDrink

func ActivateDrink(name string) (bool, error)

func AddDrink

func AddDrink(name string, drink models.Drink) (models.DrinkDB, error)

func DeactivateDrink

func DeactivateDrink(name string) (bool, error)

func DeleteDeInitializeMachine

func DeleteDeInitializeMachine() (bool, error)

func GetAvailableDrinks

func GetAvailableDrinks() ([]models.DrinkDB, error)

func GetConsumeDrink

func GetConsumeDrink(name string, den models.Denomination) (bool, models.Denomination, models.Drink, error)

func GetCurrentMoney

func GetCurrentMoney() *models.Denomination

func GetDenominationValueByName

func GetDenominationValueByName(denomination string) (string, error)

func GetDrinkByName

func GetDrinkByName(name string) (models.Drink, error)

func GetIngredientValueByName

func GetIngredientValueByName(name string) (string, error)

func GetMachineIngredients

func GetMachineIngredients() *models.Ingredient

func InitDatabaseFromConfig

func InitDatabaseFromConfig()

func InitializeMachine

func InitializeMachine(ing models.Ingredient, den models.Denomination) (bool, error)

func PutIngredientsByName

func PutIngredientsByName(ingredient string, value uint16) (models.Ingredient, error)

func RemoveDrink

func RemoveDrink(name string) (bool, error)

func UpdateDenominationPatch

func UpdateDenominationPatch(den models.Denomination) (models.Denomination, error)

func UpdateDenominationPut

func UpdateDenominationPut(den models.Denomination) (models.Denomination, error)

func UpdateDenominationValueByName

func UpdateDenominationValueByName(denomination string, value int) (models.Denomination, error)

func UpdateIngredientPatch

func UpdateIngredientPatch(ing models.Ingredient) (models.Ingredient, error)

func UpdateIngredientPut

func UpdateIngredientPut(ing models.Ingredient) (models.Ingredient, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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