hclparser

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyBody added in v0.12.0

func EmptyBody() hcl.Body

EmptyBody returns a body with no content. This body can be used as a placeholder when a body is required but no body content is available.

func FilterExcludeBody added in v0.10.0

func FilterExcludeBody(body hcl.Body, schema *hcl.BodySchema) hcl.Body

func FilterIncludeBody added in v0.10.0

func FilterIncludeBody(body hcl.Body, schema *hcl.BodySchema) hcl.Body

func MergeBodies added in v0.12.0

func MergeBodies(bodies []hcl.Body) hcl.Body

MergeBodies is like MergeFiles except it deals directly with bodies, rather than with entire files.

func MergeFiles added in v0.12.0

func MergeFiles(files []*hcl.File) hcl.Body

MergeFiles combines the given files to produce a single body that contains configuration from all of the given files.

The ordering of the given files decides the order in which contained elements will be returned. If any top-level attributes are defined with the same name across multiple files, a diagnostic will be produced from the Content and PartialContent methods describing this error in a user-friendly way.

func Stdlib added in v0.11.0

func Stdlib() map[string]function.Function

Types

type Opt

type Opt struct {
	LookupVar     func(string) (string, bool)
	Vars          map[string]string
	ValidateLabel func(string) error
}

type ParseMeta added in v0.16.0

type ParseMeta struct {
	Renamed      map[string]map[string][]string
	AllVariables []*Variable
}

func Parse

func Parse(b hcl.Body, opt Opt, val interface{}) (*ParseMeta, hcl.Diagnostics)

type Variable added in v0.16.0

type Variable struct {
	Name        string
	Description string
	Value       *string
}

type WithEvalContexts added in v0.11.0

type WithEvalContexts interface {
	GetEvalContexts(base *hcl.EvalContext, block *hcl.Block, loadDeps func(hcl.Expression) hcl.Diagnostics) ([]*hcl.EvalContext, error)
}

type WithGetName added in v0.11.0

type WithGetName interface {
	GetName(ectx *hcl.EvalContext, block *hcl.Block, loadDeps func(hcl.Expression) hcl.Diagnostics) (string, error)
}

Jump to

Keyboard shortcuts

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