hcl

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicContext

func BasicContext(vaultGetter vaultHelpers.VaultGetter) *hcl.EvalContext

func FullContext

func FullContext(ctx context.Context, parent *hcl.EvalContext, vaultInst *vault.Vault, cache state.Cache) *hcl.EvalContext

func MapToCtyVal

func MapToCtyVal(val any, cfg MappingCfg) (cty.Value, error)

func MockContext

func MockContext(ctx context.Context, cache state.Cache) *hcl.EvalContext

Types

type GenericBlock

type GenericBlock struct {
	BlockBody  hcl.Body `hcl:",remain"`
	ModuleName string   `hcl:",label"`
	BlockName  string   `hcl:",label"`
}

type GenericBlocks

type GenericBlocks []GenericBlock

func (GenericBlocks) Blocks

func (b GenericBlocks) Blocks() []GenericBlock

type LocalsBlock

type LocalsBlock struct {
	hcl.Body `hcl:",remain"`
}

type MappingCfg

type MappingCfg struct {
	MapAsObject bool
	StructAsMap bool
}

type Marshaler

type Marshaler interface {
	MarshalHCL(block *hclwrite.Block) error
}

type ModulesSpec

type ModulesSpec struct {
	Locals   []LocalsBlock `hcl:"locals,block"`
	Tools    GenericBlocks `hcl:"tool,block"`
	Tasks    GenericBlocks `hcl:"task,block"`
	Builds   GenericBlocks `hcl:"build,block"`
	Packages GenericBlocks `hcl:"package,block"`
	// contains filtered or unexported fields
}

func (ModulesSpec) Repository

func (s ModulesSpec) Repository(
	evalCtx *hcl.EvalContext,
	diagsWriter hcl.DiagnosticWriter,
	registry *modules.TypeRegistry,
	outDir string,
	opts ...RepositoryOption,
) (*modules.Repository, error)

type Parser

type Parser struct {
	Body hcl.Body
	// contains filtered or unexported fields
}

func NewParser

func NewParser(logger *slog.Logger, inputFS fs.FS) *Parser

func (*Parser) DiagsWriter

func (p *Parser) DiagsWriter() hcl.DiagnosticWriter

func (*Parser) Parse

func (p *Parser) Parse(ctx *hcl.EvalContext, val any) error

func (*Parser) ReadFiles

func (p *Parser) ReadFiles(ctx context.Context) (err error)

type RepositoryOption

type RepositoryOption func(evalCtx *hcl.EvalContext) error

func WithGlobalVariable

func WithGlobalVariable(key string, value any) RepositoryOption

type Writer

type Writer[T modules.ModuleWithMeta] struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter[T modules.ModuleWithMeta](w io.Writer, opts ...WriterOption) *Writer[T]

func (*Writer[T]) Write

func (w *Writer[T]) Write(in T) error

type WriterOption

type WriterOption func(*writerCfg)

func WithSkipZeroValues

func WithSkipZeroValues(skip bool) WriterOption

Jump to

Keyboard shortcuts

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