Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Vault VaultConfig `hcl:"vault,block"` Plugins []plugins.PluginConfig `hcl:"plugin,block"` }
func NewConfig ¶
NewConfig decodes an HCL configuration file into a Config struct, returning an error upon failure. It takes filename as a parameter to use in error messages while parsing, and a byte slice containing the actual configuration itself. It then uses hclsimple to parse the configuration and validates it using Config.Validate() before returning it. If this function returns without an error then the config should be valid to use.
func NewConfigFromFile ¶
NewConfigFromFile reads the file from filename and calls NewConfig with its contents
type VaultConfig ¶
type VaultConfig struct { VaultAddress string `hcl:"api_address"` VaultToken string `hcl:"token"` SSHConfig []SSH `hcl:"ssh,block"` }
func (*VaultConfig) Validate ¶
func (c *VaultConfig) Validate() error
func (*VaultConfig) WriteHCL ¶
func (c *VaultConfig) WriteHCL(hclBody *hclwrite.Body)
WriteHCL uses the hclwrite package to encode itself into HCL. It supports $ENVVARS for the string values, in that format. This allows users in a wizard to specify the string params in a shell-like syntax, which will then be serialised into the HCL syntax of env("ENVVARS")