parser

package
v0.4.2-rc3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const FabricFileExt = ".fabric"

Variables

This section is empty.

Functions

func AddIfMissing

func AddIfMissing[M ~map[K]V, K comparable, V definitions.FabricBlock](m M, key K, newBlock V) *hcl.Diagnostic

func FindFabricFiles

func FindFabricFiles(rootDir fs.FS, recursive bool, fn func(path string)) (diags diagnostics.Diag)

Calls fn with paths to every *.fabric files and collects errors into the returned diags.

func ParseVars added in v0.4.2

func ParseVars(ctx context.Context, block *hclsyntax.Block, localVar *hclsyntax.Attribute) (parsed *definitions.ParsedVars, diags diagnostics.Diag)

func PluginMapToCty

func PluginMapToCty[V definitions.FabricBlock](plugins map[definitions.Key]V) (content, data, publish cty.Value)

func Resolve

func Resolve[B definitions.FabricBlock](db *DefinedBlocks, expr hcl.Expression) (res B, diags diagnostics.Diag)

Types

type DefinedBlocks

type DefinedBlocks struct {
	GlobalConfig *definitions.GlobalConfig
	Config       map[definitions.Key]*definitions.Config
	Documents    map[string]*definitions.Document
	Sections     map[string]*definitions.Section
	Plugins      map[definitions.Key]*definitions.Plugin
}

func NewDefinedBlocks

func NewDefinedBlocks() *DefinedBlocks

func ParseDir

func ParseDir(dir fs.FS) (*DefinedBlocks, map[string]*hcl.File, diagnostics.Diag)

func (*DefinedBlocks) AsValueMap

func (db *DefinedBlocks) AsValueMap() map[string]cty.Value

func (*DefinedBlocks) DefaultConfig

func (db *DefinedBlocks) DefaultConfig(pluginKind, pluginName string) (config *definitions.Config)

func (*DefinedBlocks) DefaultConfigFor

func (db *DefinedBlocks) DefaultConfigFor(plugin *definitions.Plugin) (config *definitions.Config)

func (*DefinedBlocks) Merge

func (db *DefinedBlocks) Merge(other *DefinedBlocks) (diags diagnostics.Diag)

func (*DefinedBlocks) ParseDocument

func (db *DefinedBlocks) ParseDocument(ctx context.Context, d *definitions.Document) (doc *definitions.ParsedDocument, diags diagnostics.Diag)

func (*DefinedBlocks) ParsePlugin

func (db *DefinedBlocks) ParsePlugin(ctx context.Context, plugin *definitions.Plugin) (res *definitions.ParsedPlugin, diags diagnostics.Diag)

Evaluates a defined plugin.

func (*DefinedBlocks) ParseSection

func (db *DefinedBlocks) ParseSection(ctx context.Context, section *definitions.Section) (res *definitions.ParsedSection, diags diagnostics.Diag)

Evaluates a defined plugin.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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