{"modulePath":"github.com/c3xdev/c3x","version":"v1.0.2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package codegen\n\nContains routines for generating terraform code\n\n## Constants\n\n```go\nconst (\n\t// A comment that is added to the top of the generated file to indicate that this file was generated by Terragrunt.\n\t// We use a hardcoded random string at the end to make the string further unique.\n\tTerragruntGeneratedSignature = \"Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa\"\n\n\t// The default prefix to use for comments in the generated file\n\tDefaultCommentPrefix = \"# \"\n)\n```\n\n```go\nconst (\n\tExistsErrorStr               = \"error\"\n\tExistsSkipStr                = \"skip\"\n\tExistsOverwriteStr           = \"overwrite\"\n\tExistsOverwriteTerragruntStr = \"overwrite_terragrunt\"\n)\n```\n\n## Functions\n\n```go\nfunc RemoteStateConfigToTerraformCode(backend string, config map[string]interface{}) ([]byte, error)\n```\nConvert the arbitrary map that represents a remote state config into HCL code to configure that remote state.\n\n```go\nfunc WriteToFile(terragruntOptions *options.TerragruntOptions, basePath string, config GenerateConfig) error\n```\nWriteToFile will generate a new file at the given target path with the given contents. If a file already exists at the target path, the behavior depends on the value of IfExists: - if ExistsError, return an error. - if ExistsSkip, do nothing and return - if ExistsOverwrite, overwrite the existing file\n\n## Types\n\n```go\ntype GenerateConfig struct {\n\tPath             string `cty:\"path\"`\n\tIfExists         GenerateConfigExists\n\tIfExistsStr      string `cty:\"if_exists\"`\n\tCommentPrefix    string `cty:\"comment_prefix\"`\n\tContents         string `cty:\"contents\"`\n\tDisableSignature bool   `cty:\"disable_signature\"`\n\tDisable          bool   `cty:\"disable\"`\n}\n```\nConfiguration for generating code\n\n```go\ntype GenerateConfigExists int\n```\nAn enum to represent valid values for if\\_exists\n\n```go\nconst (\n\tExistsError GenerateConfigExists = iota\n\tExistsSkip\n\tExistsOverwrite\n\tExistsOverwriteTerragrunt\n\tExistsUnknown\n)\n```\n\n```go\nfunc GenerateConfigExistsFromString(val string) (GenerateConfigExists, error)\n```\nGenerateConfigExistsFromString converts a string representation of if\\_exists into the enum, returning an error if it is not set to one of the known values.\n\n```go\ntype GenerateFileExistsError struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (err GenerateFileExistsError) Error() string\n```\n\n```go\ntype UnknownGenerateIfExistsVal struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (err UnknownGenerateIfExistsVal) Error() string\n```\n\n","path":"github.com/c3xdev/c3x/internal/hclstack/codegen","name":"codegen","synopsis":"Contains routines for generating terraform code","isRedistributable":true}
