convert

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bulk

func Bulk(concurrency int, paths []string, options Options) ([]byte, error)

Bulk converts multiple HCL files concurrently to their JSON representation. The resulting byte slice contains a JSON object keyed by file path, e.g.:

{
  "path/to/file.tf":{"resource":{"aws_route53_record":{"type": "CNAME", ...}}}},
  "path/to/otherfile.tf":{"variable":{"foo":{"value": "bar"}}}
}

func Bytes

func Bytes(bytes []byte, filename string, options Options) ([]byte, error)

Bytes takes the contents of an HCL file, as bytes, and converts them into a JSON representation of the HCL file.

func File

func File(path string, options Options) ([]byte, error)

File takes the path to an HCL file and converts its contents to its JSON representation.

func Reader

func Reader(r io.Reader, filename string, options Options) ([]byte, error)

Reader reads HCL file contents from r and converts it to its JSON representation.

Types

type Options

type Options struct {
	Simplify bool
}

Options for the hcl2json converter.

Jump to

Keyboard shortcuts

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