Documentation ¶
Index ¶
- Constants
- func FormatCookingRational(num float64) (s string)
- func FormatCost(cost float64) (s string)
- func FormatDuration(hours float64) (s string)
- func FormatMeasure(amount float64, measure string) (s string)
- func GetMD5Hash(text string) string
- func SetLogLevel(level string) (err error)
- type Dag
- type Element
- type Reaction
- type Reactions
- type RequestFromApp
- type UpdateApp
- type UpdateAppDirections
- type UpdateAppIngredients
Constants ¶
View Source
const Day = (24 * time.Hour)
View Source
const Week = (7 * 24 * time.Hour)
View Source
const Year = (365 * 24 * time.Hour)
Variables ¶
This section is empty.
Functions ¶
func FormatCookingRational ¶
func FormatCost ¶
func FormatDuration ¶
func FormatMeasure ¶
func GetMD5Hash ¶
Types ¶
type Dag ¶
type Dag struct { ParallelHours float64 `toml:"p_hours" json:"p_hours,omitempty"` SerialHours float64 `toml:"s_hours" json:"s_hours,omitempty"` Directions string `toml:"directions" json:"directions,omitempty"` Notes string `toml:"notes" json:"notes,omitempty"` Product Element `toml:"product" json:"product,omitempty"` Reactant []Element `toml:"reactant" json:"reactant,omitempty"` Children []*Dag }
Dag is the format that the reactions are parsed into. Each root only corresponds to a single Product (which is different than a Reaction). The children correspond to dags of the reactions of the reactants. Everything else is pretty much carried over from the reaction.
type Element ¶
type Element struct { // Name is the name of the product/reactant Name string `toml:"name" json:"name,omitempty"` // Amount is the amount Amount float64 `toml:"amount" json:"amount,omitempty"` // Measure is the type of measurement, either // "grams" (weight), "cups" (volume), "acres" (sq ft), // or "whole" Measure string `toml:"measure" json:"measure,omitempty"` // Price is the cost per amount+measure, specified on products. Price float64 `toml:"price" json:"price,omitempty"` // Notes are for references Notes string `toml:"notes" json:"notes,omitempty"` }
type Reaction ¶
type Reaction struct { // ParallelHours it takes to create the products from reactants, in parallel. // For example, trees grow at the same rate no matter how many there are, // so there time cost would be almost entirely "parallel". Parallel time // does not scale when scaling the recipe ParallelHours float64 `toml:"p_hours" json:"p_hours,omitempty"` // SerialHours is the serial amount of time needed, time that scales // proportional to the quantities. SerialHours float64 `toml:"s_hours" json:"s_hours,omitempty"` Directions string `toml:"directions" json:"directions,omitempty"` Notes string `toml:"notes" json:"notes,omitempty"` Product []Element `toml:"product" json:"product,omitempty"` Reactant []Element `toml:"reactant" json:"reactant,omitempty"` // LastUpdated is the year it was last updated // (refers to the price) LastUpdated time.Time `toml:"updated" json:"updated,omitempty"` }
Reaction is the reaction that takes place, with reactants and products in either their theoretical OR practical lowest irreducible. This is the format of the toml file for all the recipes.
type RequestFromApp ¶
type UpdateApp ¶
type UpdateApp struct { MinutesToBuild float64 `json:"minutes"` Graph string `json:"graph"` Version string `json:"version"` Recipe string `json:"recipe"` Amount float64 `json:"amount"` Measure string `json:"measure"` TotalCost string `json:"totalCost"` TotalTime string `json:"totalTime"` Ingredients []UpdateAppIngredients `json:"ingredients"` Directions []UpdateAppDirections `json:"directions"` }
type UpdateAppDirections ¶
Click to show internal directories.
Click to hide internal directories.