Documentation
¶
Index ¶
- Variables
- type Hcl
- func (h *Hcl) Apply(filePath string, valueToWrite string) error
- func (h *Hcl) Changelog() string
- func (h *Hcl) Condition(source string, scm scm.ScmHandler) (pass bool, message string, err error)
- func (h *Hcl) Query(resourceFile file) (string, error)
- func (h *Hcl) Read() error
- func (h *Hcl) Source(workingDir string, resultSource *result.Source) error
- func (h *Hcl) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error
- func (h *Hcl) UpdateAbsoluteFilePath(workDir string)
- type Spec
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSpecFileUndefined is returned if a file wasn't specified ErrSpecFileUndefined = errors.New("hcl file undefined") // ErrSpecPathUndefined is returned if a path wasn't specified ErrSpecPathUndefined = errors.New("hcl path undefined") // ErrSpecFileAndFilesDefined when we both spec File and Files have been specified ErrSpecFileAndFilesDefined = errors.New("parameter \"file\" and \"files\" are mutually exclusive") // ErrWrongSpec is returned when the Spec has wrong content ErrWrongSpec error = errors.New("wrong spec content") )
Functions ¶
This section is empty.
Types ¶
type Hcl ¶
type Hcl struct {
// contains filtered or unexported fields
}
func (*Hcl) Changelog ¶
Changelog returns the changelog for this resource, or an empty string if not supported
func (*Hcl) Read ¶
Read puts the content of the file(s) as value of the y.files map if the file(s) exist(s) or log the non existence of the file
func (*Hcl) UpdateAbsoluteFilePath ¶
type Spec ¶
type Spec struct {
/*
"file" defines the hcl file path to interact with.
compatible:
* source
* condition
* target
remark:
* "file" and "files" are mutually exclusive
* protocols "https://", "http://", and "file://" are supported in path for source and condition
*/
File string `yaml:",omitempty"`
/*
"files" defines the list of hcl files path to interact with.
compatible:
* source
* condition
* target
remark:
* file and files are mutually exclusive
* when using as a source only one file is supported
* protocols "https://", "http://", and "file://" are supported in file path for source and condition
*/
Files []string `yaml:",omitempty"`
/*
"path" defines the hcl attribute path.
compatible:
* source
* condition
* target
example:
* path: resource.aws_instance.app_server.ami
* path: resource.helm_release.prometheus.version
* path: plugin.aws.version
*/
Path string `yaml:",omitempty"`
/*
"value" is the value associated with a hcl path.
compatible:
* condition
* target
default:
When used from a condition or a target, the default value is set to linked source output.
*/
Value string `yaml:",omitempty"`
}
"hcl" defines the specification for manipulating "hcl" files. It can be used as a "source", a "condition", or a "target".
Click to show internal directories.
Click to hide internal directories.