config

package
v0.0.0-...-f01fd73 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGardenDirPath

func FindGardenDirPath() (string, string, error)

FindGardenDirPath ...

Types

type GardenMapModel

type GardenMapModel struct {
	Plants map[string]PlantModel `json:"plants" yaml:"plants"`
	Zones  map[string]ZoneModel  `json:"zones" yaml:"zones"`
}

GardenMapModel ...

func CreateGardenMapModelFromYMLFile

func CreateGardenMapModelFromYMLFile(pth string) (GardenMapModel, error)

CreateGardenMapModelFromYMLFile ...

func LoadGardenMap

func LoadGardenMap(gardenDirPath string) (GardenMapModel, string, error)

LoadGardenMap ..

gardenDirPath is optional, if provided will be used as the Garden Dir path
if not provided the standard .garden dir paths will be checked

func (GardenMapModel) CollectAllVarsForPlant

func (gardenMap GardenMapModel) CollectAllVarsForPlant(plantID string) (PlantVarsMap, error)

CollectAllVarsForPlant ...

collects all the Vars for a plant, including the ones defined for
the plant's zones

In case a variable is defined in multiple Zones or in a Zone and in the Plant

as well: Plant's Vars will always be the #1 priority, no matter whether
it's also defined in a Zone or not.
In case of different Zones, the last one in the Plant's Zones list
will be the one which's Var will be used, it'll overwrite other
zones' previously defined Vars for the same key.

func (GardenMapModel) FilteredPlants

func (gardenMap GardenMapModel) FilteredPlants(plantID, zone string) PlantsMap

FilteredPlants ...

func (GardenMapModel) FilteredPlantsIDs

func (gardenMap GardenMapModel) FilteredPlantsIDs(plantID, zone string) []string

FilteredPlantsIDs ...

type PlantModel

type PlantModel struct {
	Path  string       `json:"path" yaml:"path"`
	Seed  string       `json:"seed" yaml:"seed"`
	Vars  PlantVarsMap `json:"vars" yaml:"vars"`
	Zones []string     `json:"zones" yaml:"zones"`
}

PlantModel ...

func (PlantModel) ExpandedPath

func (plant PlantModel) ExpandedPath(plantID string) string

ExpandedPath ...

type PlantVarsMap

type PlantVarsMap map[string]string

PlantVarsMap ...

type PlantsMap

type PlantsMap map[string]PlantModel

PlantsMap ...

type ZoneModel

type ZoneModel struct {
	Vars PlantVarsMap `json:"vars" yaml:"vars"`
}

ZoneModel ..

Jump to

Keyboard shortcuts

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