Documentation ¶
Overview ¶
Package hcl provides some helper functions for various github.com/hashicorp/hcl/v2 packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lockfile ¶
type Lockfile struct { Path string Providers []*LockfileProvider `hcl:"provider,block"` }
Lockfile represents a Terraform lockfile
func ParseLockfile ¶
ParseLockfile parses a given file as a Terraform lockfile, and returns a Lockfile object representing the configuration. Will return an error if: the HCL parser fails to parse the file, or fails to read the file into the lockfile schema, or the file contains hcl blocks other than providers.
func (*Lockfile) CompactProviders ¶
CompactProviders returns a list of the receiver's providers, formatted in short (compact) strings, e.g. "name@version".
type LockfileProvider ¶
type LockfileProvider struct { ID string `hcl:"id,label"` Version string `hcl:"version"` Constraints string `hcl:"constraints,optional"` Hashes []string `hcl:"hashes,optional"` }
LockfileProvider represents a single `provider` block of a Lockfile
func (*LockfileProvider) String ¶
func (lp *LockfileProvider) String() string
type Module ¶
type Module interface { Configuration() *configuration Module() *tfconfig.Module ParseModuleDirectory(string) error Parser() *hclparse.Parser ParseTerraformFile(string) error DependencyGraph() (string, error) }
Module is something that can parse a terraform module (configuration directory)