Documentation
¶
Index ¶
- Constants
- func ApplyFileSpecificToContext(ctx context.Context, tange hcl.Range, child *hcl.EvalContext)
- func EncodeExpression(e hclsyntax.Expression, ectx *hcl.EvalContext) (any, hcl.Diagnostics, error)
- func EvaluateAttr(ctx context.Context, name string, attr hclsyntax.Expression, ...) hcl.Diagnostics
- func ExtractUserFuncs(ctx context.Context, ibdy hcl.Body, parent *hcl.EvalContext) (map[string]function.Function, hcl.Diagnostics)
- func ExtractVariables(ctx context.Context, bdy *hclsyntax.Body, parentctx *SudoContext) hcl.Diagnostics
- func InstanceLocationStringToHCLRange(instLoc string, msg string, cnt hclsyntax.Expression, ectx *hcl.EvalContext, ...) (hcl.Expression, hcl.Diagnostics)
- func LoadValidationErrors(ctx context.Context, cnt hclsyntax.Expression, ectx *hcl.EvalContext, ...) (hcl.Diagnostics, error)
- func NewContextFromBody(ctx context.Context, body *hclsyntax.Body, parent *SudoContext) (*hcl.EvalContext, hcl.Diagnostics, error)
- func NewContextualizedFunctionMap(ectx map[string]cty.Value, file string) map[string]function.Function
- func NewFunctionMap() map[string]function.Function
- func NewGetMetaKeyFunc(str string) function.Function
- func NewGlobalContextualizedFunctionMap(ectx map[string]cty.Value) map[string]function.Function
- func NewRefFunctionFromPath(ctx context.Context, start string) function.Function
- func NewUnknownBlockEvaluation(ctx context.Context, parentctx *SudoContext, block *hclsyntax.Block) (diags hcl.Diagnostics)
- type AnyBlockEvaluation
- type FileBlockEvaluation
- func NewGenBlockEvaluation(ctx context.Context, sctx *SudoContext, file *hclsyntax.Body) (res *FileBlockEvaluation, diags hcl.Diagnostics, err error)
- func ProccessBulk(ctx context.Context, fs afero.Fs, files []string) ([]*FileBlockEvaluation, hcl.Diagnostics, error)
- func Process(ctx context.Context, fs afero.Fs, file string) (*FileBlockEvaluation, hcl.Diagnostics, error)
- type PreCtyValue
- type SudoContext
- func NewContextFromFile(ctx context.Context, fle []byte, name string) (*hcl.File, *SudoContext, *hclsyntax.Body, hcl.Diagnostics, error)
- func NewContextFromFiles(ctx context.Context, fle map[string][]byte, parent *hcl.EvalContext) (*hcl.File, *SudoContext, *hclsyntax.Body, map[string]*hclsyntax.Body, ...)
- func (me *SudoContext) ApplyArray(arr []cty.Value)
- func (me *SudoContext) ApplyKeyVal(key string, val cty.Value)
- func (me *SudoContext) ApplyValue(val cty.Value)
- func (me *SudoContext) ApplyValueMap(val map[string]cty.Value)
- func (wc *SudoContext) BuildStaticEvalContext() *hcl.EvalContext
- func (wc *SudoContext) BuildStaticEvalContextWithFileData(file string) *hcl.EvalContext
- func (me *SudoContext) BuildStaticEvalVars() map[string]cty.Value
- func (me *SudoContext) BuildStaticVarsList() []cty.Value
- func (me *SudoContext) Functions() map[string]function.Function
- func (me *SudoContext) NewArrayChild() *SudoContext
- func (me *SudoContext) NewChild(key string) *SudoContext
- func (me *SudoContext) NewNestedChild(key ...string) *SudoContext
- func (wc *SudoContext) Root() *SudoContext
- func (me *SudoContext) ToValue() cty.Value
- type ValidationBlock
Constants ¶
View Source
const ArrKey = "____arr"
View Source
const FilesKey = "____files"
View Source
const MetaKey = "____meta"
Variables ¶
This section is empty.
Functions ¶
func ApplyFileSpecificToContext ¶ added in v0.49.0
func EncodeExpression ¶ added in v0.49.0
func EncodeExpression(e hclsyntax.Expression, ectx *hcl.EvalContext) (any, hcl.Diagnostics, error)
func EvaluateAttr ¶ added in v0.49.0
func EvaluateAttr(ctx context.Context, name string, attr hclsyntax.Expression, parentctx *SudoContext) hcl.Diagnostics
func ExtractUserFuncs ¶
func ExtractVariables ¶
func ExtractVariables(ctx context.Context, bdy *hclsyntax.Body, parentctx *SudoContext) hcl.Diagnostics
func InstanceLocationStringToHCLRange ¶
func InstanceLocationStringToHCLRange(instLoc string, msg string, cnt hclsyntax.Expression, ectx *hcl.EvalContext, file hcl.Body) (hcl.Expression, hcl.Diagnostics)
func LoadValidationErrors ¶
func LoadValidationErrors(ctx context.Context, cnt hclsyntax.Expression, ectx *hcl.EvalContext, errv error, bdy hcl.Body) (hcl.Diagnostics, error)
func NewContextFromBody ¶ added in v0.48.0
func NewContextFromBody(ctx context.Context, body *hclsyntax.Body, parent *SudoContext) (*hcl.EvalContext, hcl.Diagnostics, error)
func NewContextualizedFunctionMap ¶ added in v0.46.0
func NewFunctionMap ¶
func NewGetMetaKeyFunc ¶ added in v0.48.0
func NewGlobalContextualizedFunctionMap ¶ added in v0.47.0
func NewRefFunctionFromPath ¶
func NewUnknownBlockEvaluation ¶
func NewUnknownBlockEvaluation(ctx context.Context, parentctx *SudoContext, block *hclsyntax.Block) (diags hcl.Diagnostics)
Types ¶
type AnyBlockEvaluation ¶
type FileBlockEvaluation ¶
type FileBlockEvaluation struct {
Name string
Schema string
Path string
OrderedOutput yaml.MapSlice
RawOutput any
Source string
}
func NewGenBlockEvaluation ¶
func NewGenBlockEvaluation(ctx context.Context, sctx *SudoContext, file *hclsyntax.Body) (res *FileBlockEvaluation, diags hcl.Diagnostics, err error)
func ProccessBulk ¶ added in v0.47.0
func ProccessBulk(ctx context.Context, fs afero.Fs, files []string) ([]*FileBlockEvaluation, hcl.Diagnostics, error)
func Process ¶
func Process(ctx context.Context, fs afero.Fs, file string) (*FileBlockEvaluation, hcl.Diagnostics, error)
func (*FileBlockEvaluation) Encode ¶
func (me *FileBlockEvaluation) Encode() ([]byte, error)
func (*FileBlockEvaluation) WriteToFile ¶
func (*FileBlockEvaluation) WriteToReader ¶
type PreCtyValue ¶ added in v0.49.0
type SudoContext ¶ added in v0.49.0
type SudoContext struct {
ParentKey string
Parent *SudoContext
Map map[string]*SudoContext
Array []*SudoContext
Value *cty.Value
UserFuncs map[string]function.Function
// contains filtered or unexported fields
}
func NewContextFromFile ¶
func NewContextFromFiles ¶ added in v0.48.0
func (*SudoContext) ApplyArray ¶ added in v0.49.0
func (me *SudoContext) ApplyArray(arr []cty.Value)
func (*SudoContext) ApplyKeyVal ¶ added in v0.49.0
func (me *SudoContext) ApplyKeyVal(key string, val cty.Value)
func (*SudoContext) ApplyValue ¶ added in v0.49.0
func (me *SudoContext) ApplyValue(val cty.Value)
func (*SudoContext) ApplyValueMap ¶ added in v0.49.0
func (me *SudoContext) ApplyValueMap(val map[string]cty.Value)
func (*SudoContext) BuildStaticEvalContext ¶ added in v0.49.0
func (wc *SudoContext) BuildStaticEvalContext() *hcl.EvalContext
func (*SudoContext) BuildStaticEvalContextWithFileData ¶ added in v0.49.0
func (wc *SudoContext) BuildStaticEvalContextWithFileData(file string) *hcl.EvalContext
func (*SudoContext) BuildStaticEvalVars ¶ added in v0.49.0
func (me *SudoContext) BuildStaticEvalVars() map[string]cty.Value
func (*SudoContext) BuildStaticVarsList ¶ added in v0.49.0
func (me *SudoContext) BuildStaticVarsList() []cty.Value
func (*SudoContext) Functions ¶ added in v0.49.0
func (me *SudoContext) Functions() map[string]function.Function
func (*SudoContext) NewArrayChild ¶ added in v0.49.0
func (me *SudoContext) NewArrayChild() *SudoContext
func (*SudoContext) NewChild ¶ added in v0.49.0
func (me *SudoContext) NewChild(key string) *SudoContext
func (*SudoContext) NewNestedChild ¶ added in v0.49.0
func (me *SudoContext) NewNestedChild(key ...string) *SudoContext
func (*SudoContext) Root ¶ added in v0.49.0
func (wc *SudoContext) Root() *SudoContext
func (*SudoContext) ToValue ¶ added in v0.49.0
func (me *SudoContext) ToValue() cty.Value
type ValidationBlock ¶
Click to show internal directories.
Click to hide internal directories.