Documentation ¶
Overview ¶
Service meals tracks calories and imports them from fddb.
Index ¶
Constants ¶
Variables ¶
View Source
var Module = &services.Module{ Name: "meals", Version: "1.0", NewInstance: NewService, }
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
type Product ¶
type Product struct { Id int64 `json:"-"` RefId int64 `json:"ref_id,omitempty"` Name string `json:"name,omitempty"` Code string `json:"code,omitempty"` ServingWeight Weight `json:"serving_weight,omitempty"` ServingVolume Volume `json:"serving_volume,omitempty"` Stats CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
type Service ¶
func NewService ¶
func NewService(deps *Dependencies) *Service
type Serving ¶
type Serving struct { Id int64 `json:"-"` RefId int64 `json:"ref_id,omitempty"` Name string `json:"name"` AmountWeight Weight `json:"amount_weight"` AmountVolume Volume `json:"amount_volume"` Time time.Time `json:"time" sql:"index"` ProductId int64 `json:"-"` Product *Product `json:"product,omitempty"` Size float64 `json:"size,omitempty" sql:"-"` CalculatedStats *Stats `json:"stats,omitempty"` }
type ServingFilter ¶
type ServingStats ¶
func (ServingStats) String ¶
func (s ServingStats) String() string
type Stats ¶
type Stats struct { Weight Weight `json:"weight,omitempty"` Volume Volume `json:"volume,omitempty"` Energy Energy `json:"energy,omitempty"` Fat Weight `json:"fat,omitempty"` Carbohydrates Weight `json:"carbohydrates,omitempty"` Sugar Weight `json:"sugar,omitempty"` Protein Weight `json:"protein,omitempty"` Salt Weight `json:"salt,omitempty"` Water Volume `json:"water,omitempty"` }
func (*Stats) ScaleToVolume ¶
func (*Stats) ScaleToWeight ¶
Click to show internal directories.
Click to hide internal directories.