parser

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigSpec hcldec.ObjectSpec = hcldec.ObjectSpec{
	"griffon": &GriffonSpec,
	"ssh_key": &SSHKeySpec,
}

ConfigSpec is top-level object spec for the config file.

View Source
var GriffonSpec hcldec.BlockSpec = hcldec.BlockSpec{
	TypeName: "griffon",
	Nested: &hcldec.ObjectSpec{
		"region": &hcldec.AttrSpec{
			Name:     "region",
			Type:     cty.String,
			Required: true,
		},
		"vultr_api_key": &hcldec.AttrSpec{
			Name:     "vultr_api_key",
			Type:     cty.String,
			Required: true,
		},
	},
}

GriffonSpec is the spec for the griffon block.

View Source
var SSHKeySpec hcldec.BlockListSpec = hcldec.BlockListSpec{
	TypeName: "ssh_key",
	Nested: &hcldec.ObjectSpec{
		"name": &hcldec.BlockLabelSpec{
			Index: 0,
			Name:  "name",
		},
		"ssh_key": &hcldec.AttrSpec{
			Name:     "ssh_key",
			Type:     cty.String,
			Required: true,
		},
	},
}

SSHKeySpec is the spec for the ssh_key block.

Functions

func AddBlockToEvalContext

func AddBlockToEvalContext(evalCtx *hcl.EvalContext, block blocks.Block) error

func CalculateEvaluationOrder

func CalculateEvaluationOrder(config *blocks.Config) (*graph.DependencyGraph, error)

func EvaluateConfig

func EvaluateConfig(evalCtx *hcl.EvalContext, config *blocks.Config, vc *govultr.Client) error

func GetEvalContext

func GetEvalContext() *hcl.EvalContext

func ParseHCL

func ParseHCL(filename string, src []byte, ctx *hcl.EvalContext) (*blocks.Config, error)

func ParseHCLUsingSpec

func ParseHCLUsingSpec(filename string, src []byte, ctx *hcl.EvalContext) (*blocks.Config, error)

func ParseWithBodySchema

func ParseWithBodySchema(filename string, src []byte, evalCtx *hcl.EvalContext) (*blocks.Config, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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