Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
func ParseDirectory ¶
func ParseDirectory(path string, recursive bool) ([]*File, hcl.Diagnostics)
ParseDirectory parses the directory at the given path and returns a slice of File pointers and any diagnostics encountered.
If the recursive flag is set to true, it will recursively process subdirectories as well.
Parameters:
- path: The directory path to process.
- recursive: A flag indicating whether to process subdirectories recursively.
Returns:
- []*File: A slice of pointers to the parsed files.
- hcl.Diagnostics: Any diagnostics encountered during parsing.
func ParseFactoryDirectory ¶
func ParseFactoryDirectory() ([]*File, hcl.Diagnostics)
ParseFactoryDirectory parses the "factory/" directory and returns a slice of File pointers and any diagnostics encountered.
Returns:
- []*File: A slice of pointers to the parsed files.
- hcl.Diagnostics: Any diagnostics encountered during parsing.
func (*File) GetEvalContext ¶
func (f *File) GetEvalContext(scopeID *string) *hcl.EvalContext
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is the main interface to read configuration files and other related files from disk.
It retains a cache of all files that are loaded so that they can be used to create source code snippets in diagnostics, etc.
func NewParser ¶
NewParser creates and returns a new Parser that reads files from the given filesystem. If a nil filesystem is passed then the system's "real" filesystem will be used, via afero.OsFs.
func (*Parser) DirFiles ¶
func (p *Parser) DirFiles(dir string) (primary []string, diags hcl.Diagnostics)
This is used to find all the files in a module directory. It does this by looking for all files with the .hcl extension in the immediate directory.
func (*Parser) LoadConfigFile ¶
func (p *Parser) LoadConfigFile(path string) (*File, hcl.Diagnostics)
LoadConfigFile loads a configuration file from the specified path and returns the parsed file along with any diagnostics encountered during parsing. It first loads the HCL file from the given path and then parses its content according to the defined schema. The function supports parsing pipeline blocks and filter blocks within them. It logs debug messages for each block type found. Currently, decoding of variables and stage blocks is not implemented. The function returns the parsed file and any encountered diagnostics. check out terraoform\internal\config\parser_config.go line 51
func (*Parser) LoadFiles ¶
func (p *Parser) LoadFiles(paths []string) ([]*File, hcl.Diagnostics)
LoadFiles loads multiple configuration files from the specified paths and returns a slice of File objects along with any diagnostics encountered.
func (*Parser) LoadHCLFile ¶
LoadHCLFile is a low-level method that reads the file at the given path, parses it, and returns the hcl.Body representing its root. In many cases it is better to use one of the other Load*File methods on this type, which additionally decode the root body in some way and return a higher-level construct.
If the file cannot be read at all -- e.g. because it does not exist -- then this method will return a nil body and error diagnostics. In this case callers may wish to ignore the provided error diagnostics and produce a more context-sensitive error instead.
The file will be parsed using the HCL native syntax unless the filename ends with ".json", in which case the HCL JSON syntax will be used.
type Pipeline ¶
type Pipeline struct {
Name string
Filter *Filter
Stages []*StageDefinition
}
func NewPipeline ¶
func NewPipeline() *Pipeline
type StageDefinition ¶
type Variables ¶
type Variables struct {
GlobalVariables map[string]cty.Value
StageVariables map[string]map[string]cty.Value
}
Current issues with variables. Resolving the variables such as var.foo or resolving objects var.foo.bar
Scopes, there is only 1 global scope but can be many module and resource scopes.
func NewVariables ¶
func NewVariables() *Variables