Documentation ¶
Index ¶
- Constants
- 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 Mapd(ectx map[string]cty.Value, file string, name string) (map[string]cty.Value, error)
- func MapdFile(ectx map[string]cty.Value, file string) (map[string]cty.Value, error)
- func NewContextFromFile(ctx context.Context, fle []byte, name string) (*hcl.File, *SudoContext, *BodyBuilder, hcl.Diagnostics, error)
- func NewContextFromFiles(ctx context.Context, fle map[string][]byte) (*hcl.File, *SudoContext, *BodyBuilder, hcl.Diagnostics, error)
- func NewContextualizedFunctionMap(ectx map[string]cty.Value, file string) map[string]function.Function
- func NewDynamicContextualizedFunctionMap(ectx *SudoContext) map[string]function.Function
- func NewFunctionMap() map[string]function.Function
- func NewGetMetaKeyFunc(str 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 BodyBuilder
- type FileBlockEvaluation
- func NewGenBlockEvaluation(ctx context.Context, sctx *SudoContext, file *BodyBuilder) (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 SudoContext
- func (me *SudoContext) ApplyArray(arr []cty.Value)
- func (parent *SudoContext) ApplyBody(ctx context.Context, body *hclsyntax.Body) hcl.Diagnostics
- 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 EncodeExpression ¶
func EncodeExpression(e hclsyntax.Expression, ectx *hcl.EvalContext) (any, hcl.Diagnostics, error)
func EvaluateAttr ¶
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 *BodyBuilder) (hcl.Expression, hcl.Diagnostics)
func LoadValidationErrors ¶
func LoadValidationErrors(ctx context.Context, cnt hclsyntax.Expression, ectx *hcl.EvalContext, errv error, bdy *BodyBuilder) (hcl.Diagnostics, error)
func NewContextFromFile ¶
func NewContextFromFile(ctx context.Context, fle []byte, name string) (*hcl.File, *SudoContext, *BodyBuilder, hcl.Diagnostics, error)
func NewContextFromFiles ¶
func NewContextFromFiles(ctx context.Context, fle map[string][]byte) (*hcl.File, *SudoContext, *BodyBuilder, hcl.Diagnostics, error)
func NewDynamicContextualizedFunctionMap ¶
func NewDynamicContextualizedFunctionMap(ectx *SudoContext) map[string]function.Function
func NewFunctionMap ¶
func NewGetMetaKeyFunc ¶
func NewRefFunctionFromPath ¶
func NewUnknownBlockEvaluation ¶
func NewUnknownBlockEvaluation(ctx context.Context, parentctx *SudoContext, block *hclsyntax.Block) (diags hcl.Diagnostics)
Types ¶
type AnyBlockEvaluation ¶
type BodyBuilder ¶
type BodyBuilder struct {
// contains filtered or unexported fields
}
func (*BodyBuilder) GetAllBlocksOfType ¶
func (me *BodyBuilder) GetAllBlocksOfType(name string) []*hclsyntax.Block
func (*BodyBuilder) NewRoot ¶
func (me *BodyBuilder) NewRoot() *hclsyntax.Body
func (*BodyBuilder) NewRootForFile ¶
func (me *BodyBuilder) NewRootForFile(file string) (*hclsyntax.Body, error)
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 *BodyBuilder) (res []*FileBlockEvaluation, diags hcl.Diagnostics, err error)
func ProccessBulk ¶
func (*FileBlockEvaluation) Encode ¶
func (me *FileBlockEvaluation) Encode() ([]byte, error)
func (*FileBlockEvaluation) WriteToFile ¶
func (*FileBlockEvaluation) WriteToReader ¶
type SudoContext ¶
type SudoContext struct { ParentKey string Parent *SudoContext Map map[string]*SudoContext Array []*SudoContext Value *cty.Value UserFuncs map[string]function.Function }
func (*SudoContext) ApplyArray ¶
func (me *SudoContext) ApplyArray(arr []cty.Value)
func (*SudoContext) ApplyBody ¶
func (parent *SudoContext) ApplyBody(ctx context.Context, body *hclsyntax.Body) hcl.Diagnostics
func (*SudoContext) ApplyKeyVal ¶
func (me *SudoContext) ApplyKeyVal(key string, val cty.Value)
func (*SudoContext) ApplyValue ¶
func (me *SudoContext) ApplyValue(val cty.Value)
func (*SudoContext) ApplyValueMap ¶
func (me *SudoContext) ApplyValueMap(val map[string]cty.Value)
func (*SudoContext) BuildStaticEvalContext ¶
func (wc *SudoContext) BuildStaticEvalContext() *hcl.EvalContext
func (*SudoContext) BuildStaticEvalContextWithFileData ¶
func (wc *SudoContext) BuildStaticEvalContextWithFileData(file string) *hcl.EvalContext
func (*SudoContext) BuildStaticEvalVars ¶
func (me *SudoContext) BuildStaticEvalVars() map[string]cty.Value
func (*SudoContext) BuildStaticVarsList ¶
func (me *SudoContext) BuildStaticVarsList() []cty.Value
func (*SudoContext) NewArrayChild ¶
func (me *SudoContext) NewArrayChild() *SudoContext
func (*SudoContext) NewChild ¶
func (me *SudoContext) NewChild(key string) *SudoContext
func (*SudoContext) NewNestedChild ¶
func (me *SudoContext) NewNestedChild(key ...string) *SudoContext
func (*SudoContext) Root ¶
func (wc *SudoContext) Root() *SudoContext
func (*SudoContext) ToValue ¶
func (me *SudoContext) ToValue() cty.Value
type ValidationBlock ¶
Click to show internal directories.
Click to hide internal directories.