Documentation ¶
Index ¶
- func CloneRepo(repo string, commit string, intoPath string, branch string) (err error)
- func UnmarshalFile(path string, unmarshalFunc UnmarshalFunction, obj interface{}) (err error)
- func WalkComponentTree(startingPath string, environments []string, iterator ComponentIteration) <-chan WalkResult
- type Component
- func (c *Component) AfterGenerate() (err error)
- func (c *Component) AfterInstall() (err error)
- func (c *Component) BeforeGenerate() (err error)
- func (c *Component) BeforeInstall() (err error)
- func (c *Component) ExecuteHook(hook string) (err error)
- func (c *Component) Generate(generator Generator) (err error)
- func (c *Component) Install(componentPath string, generator Generator) (err error)
- func (c *Component) InstallComponent(componentPath string) (err error)
- func (c *Component) LoadComponent() (mergedComponent Component, err error)
- func (c *Component) LoadConfig(environments []string) (err error)
- func (c *Component) RelativePathTo() string
- func (c *Component) UnmarshalComponent(marshaledType string, unmarshalFunc UnmarshalFunction, component *Component) error
- func (c *Component) Write() (err error)
- type ComponentConfig
- func (cc *ComponentConfig) GetPath(environment string) string
- func (cc *ComponentConfig) GetSubcomponentConfig(subcomponentPath []string) (subcomponentConfig ComponentConfig)
- func (cc *ComponentConfig) HasComponentConfig(path []string) bool
- func (cc *ComponentConfig) HasSubcomponentConfig(subcomponentPath []string) bool
- func (cc *ComponentConfig) Load(environment string) (err error)
- func (cc *ComponentConfig) Merge(newConfig ComponentConfig) (err error)
- func (cc *ComponentConfig) MergeConfigFile(path string, environment string) (err error)
- func (cc *ComponentConfig) MergeNamespaces(newConfig ComponentConfig) ComponentConfig
- func (cc *ComponentConfig) SetComponentConfig(path []string, value string)
- func (cc *ComponentConfig) SetConfig(subcomponentPath []string, path []string, value string)
- func (cc *ComponentConfig) UnmarshalJSONConfig(environment string) (err error)
- func (cc *ComponentConfig) UnmarshalYAMLConfig(environment string) (err error)
- func (cc *ComponentConfig) Write(environment string) (err error)
- type ComponentIteration
- type Generator
- type PathValuePair
- type UnmarshalFunction
- type WalkResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalFile ¶
func UnmarshalFile(path string, unmarshalFunc UnmarshalFunction, obj interface{}) (err error)
func WalkComponentTree ¶
func WalkComponentTree(startingPath string, environments []string, iterator ComponentIteration) <-chan WalkResult
WalkComponentTree asynchronously walks a component tree starting at `startingPath` and calls `iterator` on every node in the tree in Breadth First Order.
Returns a channel of WalkResult which can either have a Component or an Error (Error is nillable)
Same level ordering is not ensured; any nodes on the same tree level can be visited in any order. Parent->Child ordering is ensured; A parent is always visited via `iterator` before the children are visited.
Types ¶
type Component ¶
type Component struct { Name string `yaml:"name" json:"name"` Config ComponentConfig `yaml:"-" json:"-"` Generator string `yaml:"generator,omitempty" json:"generator,omitempty"` Hooks map[string][]string `yaml:"hooks,omitempty" json:"hooks,omitempty"` Serialization string `yaml:"-" json:"-"` Source string `yaml:"source,omitempty" json:"source,omitempty"` Method string `yaml:"method,omitempty" json:"method,omitempty"` Path string `yaml:"path,omitempty" json:"path,omitempty"` Version string `yaml:"version,omitempty" json:"version,omitempty"` Branch string `yaml:"branch,omitempty" json:"branch,omitempty"` Repositories map[string]string `yaml:"repositories,omitempty" json:"repositories,omitempty"` Subcomponents []Component `yaml:"subcomponents,omitempty" json:"subcomponents,omitempty"` PhysicalPath string `yaml:"-" json:"-"` LogicalPath string `yaml:"-" json:"-"` Manifest string `yaml:"-" json:"-"` }
func SynchronizeWalkResult ¶
func SynchronizeWalkResult(results <-chan WalkResult) (components []Component, err error)
SynchronizeWalkResult will synchronize a channel of WalkResult to a list of visited Components. It will return on the first Error encountered; returning the visited Components up until then and the error
func (*Component) AfterGenerate ¶
func (*Component) AfterInstall ¶
func (*Component) BeforeGenerate ¶
func (*Component) BeforeInstall ¶
func (*Component) ExecuteHook ¶
func (*Component) InstallComponent ¶
func (*Component) LoadComponent ¶
func (*Component) LoadConfig ¶
func (*Component) RelativePathTo ¶
func (*Component) UnmarshalComponent ¶
func (c *Component) UnmarshalComponent(marshaledType string, unmarshalFunc UnmarshalFunction, component *Component) error
type ComponentConfig ¶
type ComponentConfig struct { Path string `yaml:"-" json:"-"` Serialization string `yaml:"-" json:"-"` Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"` InjectNamespace bool `yaml:"injectNamespace,omitempty" json:"injectNamespace,omitempty"` Config map[string]interface{} `yaml:"config,omitempty" json:"config,omitempty"` Subcomponents map[string]ComponentConfig `yaml:"subcomponents,omitempty" json:"subcomponents,omitempty"` }
func NewComponentConfig ¶
func NewComponentConfig(path string) ComponentConfig
func (*ComponentConfig) GetPath ¶
func (cc *ComponentConfig) GetPath(environment string) string
func (*ComponentConfig) GetSubcomponentConfig ¶
func (cc *ComponentConfig) GetSubcomponentConfig(subcomponentPath []string) (subcomponentConfig ComponentConfig)
GetSubcomponentConfig returns the subcomponent config of the given component. If the subcomponent does not exist, it creates it
Returns the subcomponent config
func (*ComponentConfig) HasComponentConfig ¶
func (cc *ComponentConfig) HasComponentConfig(path []string) bool
HasComponentConfig checks if the component contains the given component configuration. The given component is specified via a configuration `path`. Returns true if it contains it, otherwise it returns false.
func (*ComponentConfig) HasSubcomponentConfig ¶
func (cc *ComponentConfig) HasSubcomponentConfig(subcomponentPath []string) bool
HasSubcomponentConfig checks if a component contains the given subcomponents of the `subcomponentPath`
Returns true if it contains the subcomponent, otherwise it returns false
func (*ComponentConfig) Load ¶
func (cc *ComponentConfig) Load(environment string) (err error)
func (*ComponentConfig) Merge ¶
func (cc *ComponentConfig) Merge(newConfig ComponentConfig) (err error)
func (*ComponentConfig) MergeConfigFile ¶
func (cc *ComponentConfig) MergeConfigFile(path string, environment string) (err error)
func (*ComponentConfig) MergeNamespaces ¶
func (cc *ComponentConfig) MergeNamespaces(newConfig ComponentConfig) ComponentConfig
func (*ComponentConfig) SetComponentConfig ¶
func (cc *ComponentConfig) SetComponentConfig(path []string, value string)
SetComponentConfig sets the `value` of the given configuration setting. The configuration setting is indicated via a configuration `path`.
func (*ComponentConfig) SetConfig ¶
func (cc *ComponentConfig) SetConfig(subcomponentPath []string, path []string, value string)
SetConfig sets or creates the configuration `value` for the given `subcomponentPath`.
func (*ComponentConfig) UnmarshalJSONConfig ¶
func (cc *ComponentConfig) UnmarshalJSONConfig(environment string) (err error)
func (*ComponentConfig) UnmarshalYAMLConfig ¶
func (cc *ComponentConfig) UnmarshalYAMLConfig(environment string) (err error)
func (*ComponentConfig) Write ¶
func (cc *ComponentConfig) Write(environment string) (err error)
type ComponentIteration ¶
type PathValuePair ¶
type UnmarshalFunction ¶
type WalkResult ¶
WalkResult is what WalkComponentTree returns. Will contain either a Component OR an Error (Error is nillable; meaning both fields can be nil)