Documentation ¶
Overview ¶
Package varparser contains the logic for parsing HCL and environment variables that Phobos API supports. It supports parsing variables passed in via flags and from files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParseEnvironmentVariablesInput ¶
ParseEnvironmentVariablesInput defines the input for ProcessEnvironmentVariables.
type ParseHCLVariablesInput ¶
ParseHCLVariablesInput defines the input for ProcessHCLVariables.
type Variable ¶
type Variable struct { Value string Key string Category pb.VariableCategory }
Variable represents a parsed HCL or environment variable.
type VariableParser ¶
type VariableParser struct {
// contains filtered or unexported fields
}
VariableParser implements functionalities needed to parse variables.
func NewVariableParser ¶
func NewVariableParser(configDirectory *string, withHCLVarsFromEnvironment bool) *VariableParser
NewVariableParser returns a new VariableProcessor.
func (*VariableParser) ParseEnvironmentVariables ¶
func (v *VariableParser) ParseEnvironmentVariables(input *ParseEnvironmentVariablesInput) ([]Variable, error)
ParseEnvironmentVariables dispatches functions to parse environment variables and returns a unique slice of parsed Variables.
Parsing precedence: 1. --env-var-file option(s). 2. --env-var option(s).
func (*VariableParser) ParseHCLVariables ¶
func (v *VariableParser) ParseHCLVariables(input *ParseHCLVariablesInput) ([]Variable, error)
ParseHCLVariables dispatches the functions to parse HCL variables and returns a unique slice of parsed Variables.
Parsing precedence: 1. HCL variables from the environment. 2. phobos.pbvars file, if present. 3. phobos.pbvars.json file, if present. 4. *.auto.pbvars.* files, if present. 5. --pb-var-file option(s). 6. --pb-var option(s).