hclread

package
v0.42.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const MetaKey = "____meta"

Variables

This section is empty.

Functions

func ExtractUserFuncs

func ExtractUserFuncs(ctx context.Context, ibdy hcl.Body, parent *hcl.EvalContext) (map[string]function.Function, hcl.Diagnostics)

func ExtractVariables

func ExtractVariables(ctx context.Context, bdy *hclsyntax.Body, parent *hcl.EvalContext) (map[string]cty.Value, 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 NewContextFromFile

func NewContextFromFile(ctx context.Context, fle []byte, name string) (*hcl.File, *hcl.EvalContext, *hclsyntax.Body, hcl.Diagnostics, error)

func NewFunctionMap

func NewFunctionMap() map[string]function.Function

func NewRefFunctionFromPath

func NewRefFunctionFromPath(ctx context.Context, start string) function.Function

func NewUnknownBlockEvaluation

func NewUnknownBlockEvaluation(ctx context.Context, ectx *hcl.EvalContext, block *hclsyntax.Block) (key string, res cty.Value, diags hcl.Diagnostics)

Types

type AnyBlockEvaluation

type AnyBlockEvaluation struct {
	Name    string
	Content map[string]cty.Value
}

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, ectx *hcl.EvalContext, file *hclsyntax.Body) (res *FileBlockEvaluation, diags hcl.Diagnostics, err 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 (me *FileBlockEvaluation) WriteToFile(ctx context.Context, fs afero.Fs) error

func (*FileBlockEvaluation) WriteToReader

func (me *FileBlockEvaluation) WriteToReader(ctx context.Context) (io.Reader, error)

type ValidationBlock

type ValidationBlock interface {
	HasValidationErrors() bool
	Encode() ([]byte, error)
}

type WorkingContext

type WorkingContext struct {
	// contains filtered or unexported fields
}

func (*WorkingContext) EvalContext

func (me *WorkingContext) EvalContext() *hcl.EvalContext

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL