Documentation
¶
Index ¶
- func CommandExists(command string) error
- func GenerateFileFromTemplate(templatedFilePath string, templateArgs interface{}) (string, error)
- func RunCommand(command string, args, successOrFail string) error
- func TemplateArgumentsToMap(templateArguments ...TemplateArgument) (map[string]string, error)
- func WaitFor(duration int, durationUnits string) error
- type TemplateArgument
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandExists ¶
func GenerateFileFromTemplate ¶
GenerateFileFromTemplate applies the template defined in templatedFilePath to templateArgs. The generated file will be named 'generated_<templated-file-base>' and it will be created in the same directory of the template.
func RunCommand ¶
func TemplateArgumentsToMap ¶
func TemplateArgumentsToMap(templateArguments ...TemplateArgument) (map[string]string, error)
TemplateArgumentsToMap uses the elements of 'templateArguments' to populate the key:value pairs of the returned map. The key is the '.Key' variable of the corresponding element, and the value is the string returned by the 'GetValue' method of said element.
Types ¶
type TemplateArgument ¶
type TemplateArgument struct { Key string EnvironmentVariable string Default string Mandatory bool }
func (TemplateArgument) GetValue ¶
func (ta TemplateArgument) GetValue() (string, error)
GetValue returns the value of the Environment Variable defined by 'TemplateArgument.EnvironmentVariable'. If 'TemplateArgument.EnvironmentVariable' is empty or the ENV. VAR. it defines is unset, 'TemplateArgument.Default' is returned. That is, if 'TemplateArgument.Mandatory' is not 'true', in which case, an error is returned.