Documentation ¶
Index ¶
- Variables
- func CtyValueToString(val cty.Value) string
- func GoTypeToCtyType(goType reflect.Type) cty.Type
- func Int(i int) *int
- func LocalsValues(blocks []Local) cty.Value
- func ToCtyValue(input interface{}) cty.Value
- func Values[T block](blocks []T) cty.Value
- type BaseBlock
- func (bb *BaseBlock) BaseValues() map[string]cty.Value
- func (bb *BaseBlock) Context() context.Context
- func (bb *BaseBlock) EvalContext() *hcl.EvalContext
- func (bb *BaseBlock) HclBlock() *hclBlock
- func (bb *BaseBlock) Id() string
- func (bb *BaseBlock) Name() string
- func (bb *BaseBlock) PreConditionCheck(ctx *hcl.EvalContext) ([]PreCondition, error)
- type BaseData
- type BaseFix
- type BaseRule
- type Config
- type CopyFileFix
- type Dag
- type Data
- type DecodeBase
- type DirExistRule
- type FailedRule
- type FileExistRule
- type FileHashRule
- type Fix
- type GitIgnoreDatasource
- type GitIgnoreFix
- type HttpDatasource
- type Local
- type LocalBlock
- type LocalFileFix
- type LocalShellFix
- type MustBeTrueRule
- type Plan
- type PreCondition
- type RenameFileFix
- type RmLocalFileFix
- type Rule
- type Validatable
- type Valuable
- type YamlTransform
- type YamlTransformFix
Constants ¶
This section is empty.
Variables ¶
View Source
var FsFactory = func() afero.Fs { return afero.NewOsFs() }
Functions ¶
func CtyValueToString ¶
func LocalsValues ¶
func ToCtyValue ¶
ToCtyValue is a function that converts a primary/collection type to cty.Value
Types ¶
type BaseBlock ¶
type BaseBlock struct {
// contains filtered or unexported fields
}
func (*BaseBlock) EvalContext ¶
func (bb *BaseBlock) EvalContext() *hcl.EvalContext
func (*BaseBlock) PreConditionCheck ¶
func (bb *BaseBlock) PreConditionCheck(ctx *hcl.EvalContext) ([]PreCondition, error)
type BaseFix ¶
type BaseFix struct {
RuleIds []string `json:"rule_ids" hcl:"rule_ids"`
}
func (*BaseFix) GetRuleIds ¶
type BaseRule ¶
type BaseRule struct {
// contains filtered or unexported fields
}
func (*BaseRule) CheckError ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) DataBlocks ¶
func (*Config) EvalContext ¶
func (c *Config) EvalContext() *hcl.EvalContext
func (*Config) LocalBlocks ¶
func (*Config) RuleBlocks ¶
type CopyFileFix ¶
type CopyFileFix struct { *BaseBlock *BaseFix Src string `json:"src" hcl:"src"` Dest string `json:"dest" hcl:"dest"` }
func (*CopyFileFix) Apply ¶
func (c *CopyFileFix) Apply() error
func (*CopyFileFix) Type ¶
func (c *CopyFileFix) Type() string
type DecodeBase ¶
type DecodeBase interface {
Decode(*hclBlock, *hcl.EvalContext) error
}
type DirExistRule ¶
type DirExistRule struct { *BaseBlock *BaseRule Dir string `hcl:"dir"` FailOnExist bool `hcl:"fail_on_exist,optional"` }
func (*DirExistRule) ExecuteDuringPlan ¶
func (d *DirExistRule) ExecuteDuringPlan() error
func (*DirExistRule) Type ¶
func (d *DirExistRule) Type() string
type FailedRule ¶
func (*FailedRule) String ¶
func (fr *FailedRule) String() string
type FileExistRule ¶
func (*FileExistRule) ExecuteDuringPlan ¶
func (f *FileExistRule) ExecuteDuringPlan() error
func (*FileExistRule) Type ¶
func (f *FileExistRule) Type() string
type FileHashRule ¶
type FileHashRule struct { *BaseBlock *BaseRule Glob string `hcl:"glob"` Hash string `hcl:"hash"` Algorithm string `hcl:"algorithm,optional" default:"sha1"` FailOnHashMismatch bool `hcl:"fail_on_hash_mismatch,optional"` HashMismatchFiles []string }
func (*FileHashRule) ExecuteDuringPlan ¶
func (fhr *FileHashRule) ExecuteDuringPlan() error
func (*FileHashRule) Type ¶
func (fhr *FileHashRule) Type() string
func (*FileHashRule) Validate ¶
func (fhr *FileHashRule) Validate() error
type GitIgnoreDatasource ¶
func (*GitIgnoreDatasource) ExecuteDuringPlan ¶
func (g *GitIgnoreDatasource) ExecuteDuringPlan() error
func (*GitIgnoreDatasource) Type ¶
func (g *GitIgnoreDatasource) Type() string
type GitIgnoreFix ¶
type GitIgnoreFix struct { *BaseBlock *BaseFix Exist []string `hcl:"exist,optional" validate:"at_least_one_of=Exist NotExist"` NotExist []string `hcl:"not_exist,optional" validate:"at_least_one_of=Exist NotExist"` }
func (*GitIgnoreFix) Apply ¶
func (g *GitIgnoreFix) Apply() error
func (*GitIgnoreFix) Type ¶
func (g *GitIgnoreFix) Type() string
type HttpDatasource ¶
type HttpDatasource struct { *BaseBlock *BaseData Url string `hcl:"url"` Method string `hcl:"method,optional" default:"GET"` RequestBody string `hcl:"request_body,optional"` RequestHeaders map[string]string `hcl:"request_headers,optional"` RetryMax int `hcl:"retry_max,optional" default:"4"` ResponseBody string ResponseHeaders map[string]string StatusCode int }
func (*HttpDatasource) ExecuteDuringPlan ¶
func (h *HttpDatasource) ExecuteDuringPlan() error
func (*HttpDatasource) Type ¶
func (h *HttpDatasource) Type() string
func (*HttpDatasource) Validate ¶
func (h *HttpDatasource) Validate() error
type LocalBlock ¶
func (*LocalBlock) BlockType ¶
func (l *LocalBlock) BlockType() string
func (*LocalBlock) Type ¶
func (l *LocalBlock) Type() string
type LocalFileFix ¶
type LocalFileFix struct { *BaseBlock *BaseFix Paths []string `json:"paths" hcl:"paths"` Content string `json:"content" hcl:"content"` Mode *fs.FileMode `json:"mode" hcl:"mode,optional" default:"0644" validate:"file_mode"` }
func (*LocalFileFix) Apply ¶
func (lf *LocalFileFix) Apply() error
func (*LocalFileFix) Type ¶
func (lf *LocalFileFix) Type() string
type LocalShellFix ¶
type LocalShellFix struct { *BaseBlock *BaseFix ExecuteCommand []string `hcl:"execute_command,optional" default:"[/bin/sh,-c]"` // The command used to execute the script. InlineShebang string `hcl:"inline_shebang,optional" validate:"required_with=Inlines"` Inlines []string `hcl:"inlines,optional" validate:"conflict_with=Script RemoteScript,at_least_one_of=Inlines Script RemoteScript"` Script string `hcl:"script,optional" validate:"conflict_with=Inlines RemoteScript,at_least_one_of=Inlines Script RemoteScript"` RemoteScript string `hcl:"remote_script,optional" validate:"conflict_with=Inlines Script,at_least_one_of=Inlines Script RemoteScript,eq=|http_url"` OnlyOn []string `` /* 129-byte string literal not displayed */ Env map[string]string `hcl:"env,optional"` }
func (*LocalShellFix) Apply ¶
func (l *LocalShellFix) Apply() (err error)
func (*LocalShellFix) Type ¶
func (l *LocalShellFix) Type() string
type MustBeTrueRule ¶
type MustBeTrueRule struct { *BaseBlock *BaseRule Condition bool `hcl:"condition"` ErrorMessage string `hcl:"error_message,optional"` }
func (*MustBeTrueRule) ExecuteDuringPlan ¶
func (m *MustBeTrueRule) ExecuteDuringPlan() error
func (*MustBeTrueRule) Type ¶
func (m *MustBeTrueRule) Type() string
type Plan ¶
type Plan struct { FailedRules []*FailedRule Fixes map[string]Fix // contains filtered or unexported fields }
type PreCondition ¶
type RenameFileFix ¶
type RenameFileFix struct { *BaseBlock *BaseFix OldName string `json:"old_name" hcl:"old_name"` NewName string `json:"new_name" hcl:"new_name"` }
func (*RenameFileFix) Apply ¶
func (rf *RenameFileFix) Apply() error
func (*RenameFileFix) Type ¶
func (rf *RenameFileFix) Type() string
type RmLocalFileFix ¶
func (*RmLocalFileFix) Apply ¶
func (r *RmLocalFileFix) Apply() error
func (*RmLocalFileFix) Type ¶
func (r *RmLocalFileFix) Type() string
type Validatable ¶
type Validatable interface {
Validate() error
}
type YamlTransform ¶
type YamlTransformFix ¶
type YamlTransformFix struct { *BaseBlock *BaseFix FilePath string `hcl:"file_path" json:"file_path" validate:"endswith=.yaml|endswith=.yml"` Transform []YamlTransform `hcl:"transform,block"` }
func (*YamlTransformFix) Apply ¶
func (y *YamlTransformFix) Apply() error
func (*YamlTransformFix) Type ¶
func (y *YamlTransformFix) Type() string
Source Files ¶
- block.go
- block_register.go
- config.go
- cty.go
- dag.go
- dag_walker.go
- data.go
- data_git_ignore.go
- data_http.go
- fix.go
- fix_copy_file.go
- fix_git_ignore.go
- fix_local_file.go
- fix_local_shell.go
- fix_rename_file.go
- fix_rm_local_file.go
- fix_yaml_transform.go
- fs.go
- hclBlock.go
- init.go
- local.go
- plan.go
- plan_action.go
- pre_condition.go
- rf_iterate.go
- rule.go
- rule_dir_exist.go
- rule_file_exist.go
- rule_file_hash.go
- rule_must_be_true.go
- validatable.go
- valuable.go
Click to show internal directories.
Click to hide internal directories.