config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Variables []VariableConfig `hcl:"variable"`
	Templates []TemplateConfig `hcl:"template"`
}

Config is a variable file config definition

type Result

type Result struct {
	Variables map[string]ast.Variable
	Templates map[string]ast.Variable
}

Result is the result of merging multiple config files

func LoadConfigFiles

func LoadConfigFiles(configFiles []string) (*Result, error)

LoadConfigFiles will load all config files and merge values into appropriate values

type TemplateConfig

type TemplateConfig struct {
	Name    string `hcl:",key"`
	Content string `hcl:"content"` // a string that contains a simple template
	File    string `hcl:"file"`    // a reference to a file that is relative to the config file
	Trim    bool   `hcl:"trim"`    // declares if whitespace should be trimmed from the file contents
}

TemplateConfig defines the structure for our template config sections

type VariableConfig

type VariableConfig struct {
	Name  string      `hcl:",key"`
	Value interface{} `hcl:"value"`
}

VariableConfig defines the structure for our variable config sections

Jump to

Keyboard shortcuts

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