package
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: Nov 23, 2022
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
func Bulk(concurrency int, paths []string, options Options) ([]byte, error)
-
func Bytes(bytes []byte, filename string, options Options) ([]byte, error)
-
func File(path string, options Options) ([]byte, error)
-
func Reader(r io.Reader, filename string, options Options) ([]byte, error)
-
type Options
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"}}}
}
Bytes takes the contents of an HCL file, as bytes, and converts
them into a JSON representation of the HCL file.
File takes the path to an HCL file and converts its contents to its JSON
representation.
Reader reads HCL file contents from r and converts it to its JSON
representation.
type Options struct {
Simplify bool
}
Options for the hcl2json converter.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.