Documentation ¶
Index ¶
Constants ¶
const ( KeyRecipeDir string = "RECIPE_DIR" KeyShoppingDir = "SHOPPING_DIR" KeyUnits = "UNITS" )
Constant key for reliably accessing `config.Get`
Variables ¶
This section is empty.
Functions ¶
func ConfigInit ¶
Creates a new config file, using the default template, using `path`.
If `recipes` or `shopping` are not empty, the passed string will be passed on to the new config file as locations for each. Otherwise, XDG_DATA_HOME defaults will be used.
If the recipe and shopping dirs don't already exist, they will be created.
func DefaultRecipesPath ¶
func DefaultRecipesPath() string
Returns the default recipes directory path
func DefaultShoppingPath ¶
func DefaultShoppingPath() string
Returns the default shopping directory path
func LoadConfig ¶
Loads a `cooklang-go` config file and returns the parsed `Config` struct.
Leave path blank to use default location. NOTE: Defaults only work with Unix based OS atm
func LoadConfigEnv ¶
func LoadConfigEnv()
Loads config from environment vars instead of a config file
Types ¶
This section is empty.