Documentation ¶
Overview ¶
package controllers
Index ¶
- Variables
- func PrometheusMiddleware() gin.HandlerFunc
- func RegisterRoutesAuth(router *gin.RouterGroup)
- func RegisterRoutesCoffeeMachine(router *gin.RouterGroup)
- func RegisterRoutesDenomination(router *gin.RouterGroup)
- func RegisterRoutesDrink(router *gin.RouterGroup)
- func RegisterRoutesIngredients(router *gin.RouterGroup)
- func RegisterRoutesStatistics(router *gin.RouterGroup)
- type Claims
- type CoffeeMachine
- type Denomination
- type Drink
- type Ingredient
- type Money
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DrinkConsumedCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "drink_consumed_total", Help: "Current instance Total number of consumed action per drink.", }, []string{"name"}, ) IngredientsConsumedCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "ingredients_consumed_total", Help: "Current instance Total number of each ingredient consumed.", }, []string{"name"}, ) MoneyEarnedCounter = prometheus.NewCounter( prometheus.CounterOpts{ Name: "money_earned_total", Help: "Current instance Total money earned.", }, ) DrinksActiveCounter = prometheus.NewGauge( prometheus.GaugeOpts{ Name: "drink_active_total", Help: "Current instance Number of activated drinks in coffeemachine.", }, ) )
Functions ¶
func PrometheusMiddleware ¶
func PrometheusMiddleware() gin.HandlerFunc
func RegisterRoutesAuth ¶
func RegisterRoutesAuth(router *gin.RouterGroup)
func RegisterRoutesCoffeeMachine ¶
func RegisterRoutesCoffeeMachine(router *gin.RouterGroup)
register route for coffeemachine in gin framework
func RegisterRoutesDenomination ¶
func RegisterRoutesDenomination(router *gin.RouterGroup)
register route for coffeemachine in gin framework
func RegisterRoutesDrink ¶
func RegisterRoutesDrink(router *gin.RouterGroup)
register route for drink in gin framework
func RegisterRoutesIngredients ¶
func RegisterRoutesIngredients(router *gin.RouterGroup)
register route for /ingredient in gin framework
func RegisterRoutesStatistics ¶
func RegisterRoutesStatistics(router *gin.RouterGroup)
Types ¶
type CoffeeMachine ¶
type CoffeeMachine struct { Ingredients Ingredient `form:"Ingredients" json:"Ingredients"` Denomination Denomination `form:"Money" json:"Money" binding:"validateDenomination"` }
used for initialization of CoffeeMachine
type Denomination ¶
type Denomination struct { Half int `form:"Half" json:"Half" binding:"required_without_all=One Two Five Ten,validateDenomination"` One int `form:"One" json:"One" binding:"required_without_all=Half Two Five Ten,validateDenomination"` Two int `form:"Two" json:"Two" binding:"required_without_all=One Half Five Ten,validateDenomination"` Five int `form:"Five" json:"Five" binding:"required_without_all=One Two Half Ten,validateDenomination"` Ten int `form:"Ten" json:"Ten" binding:"required_without_all=One Two Five Half,validateDenomination"` }
type Drink ¶
type Drink struct { Water uint16 `form:"Water" json:"Water" binding:"required_without_all=Milk Sugar CoffeeBeans TeaBeans Cups Money"` Milk uint16 `form:"Milk" json:"Milk" binding:"required_without_all=Water Sugar CoffeeBeans TeaBeans Cups Money"` Sugar uint16 `form:"Sugar" json:"Sugar" binding:"required_without_all=Milk Water CoffeeBeans TeaBeans Cups Money"` CoffeeBeans uint16 `form:"CoffeeBeans" json:"CoffeeBeans" binding:"required_without_all=Milk Sugar Water TeaBeans Cups Money"` TeaBeans uint16 `form:"TeaBeans" json:"TeaBeans" binding:"required_without_all=Milk Sugar CoffeeBeans Water Cups Money"` Cups uint16 `form:"Cups" json:"Cups" binding:"required_without_all=Milk Sugar CoffeeBeans TeaBeans Water Money"` Money float64 `form:"Money" json:"Money" binding:"required_without_all=Milk Sugar CoffeeBeans TeaBeans Cups Water"` }
type Ingredient ¶
Click to show internal directories.
Click to hide internal directories.