config

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileComment = "## Generated by Colonize init\n---\n"

Variables

View Source
var ConfigFileDefaults = ConfigFile{
	"env",
	"default",
	"This file generated by colonize",
	"_combined.tfvars",
	"_combined_variables.tf",
	"_combined_derived.tfvars",
	"_combined_derived.tf",
	"_combined.tf",
	"_remote_setup.sh",
	"remote_setup.sh",
	"derived.tfvars",
	".tfvars",
	"build_order.txt",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	// Inputs
	Environment string
	OriginPath  string
	TmplName    string
	TmplPath    string
	CfgPath     string
	RootPath    string

	// Generated
	TmplRelPaths                []string
	WalkablePaths               []string
	WalkableValPaths            []string
	CombinedValsFilePath        string
	CombinedVarsFilePath        string
	WalkableTfPaths             []string
	CombinedTfFilePath          string
	WalkableDerivedPaths        []string
	CombinedDerivedValsFilePath string
	CombinedDerivedVarsFilePath string
	CombinedRemoteFilePath      string
	RemoteFilePath              string

	// Read in from config
	ConfigFile ConfigFile
}

func LoadConfig

func LoadConfig(input *LoadConfigInput) (*Config, error)

func LoadConfigInTree

func LoadConfigInTree(path string, env string) (*Config, error)

func (*Config) GetBuildOrderPaths

func (c *Config) GetBuildOrderPaths() ([]string, error)

func (*Config) GetEnvDerivedPath

func (c *Config) GetEnvDerivedPath() string

func (*Config) GetEnvTfPath

func (c *Config) GetEnvTfPath() string

func (*Config) GetEnvValPath

func (c *Config) GetEnvValPath() string

func (*Config) IsBranch

func (c *Config) IsBranch() bool

func (*Config) IsLeaf

func (c *Config) IsLeaf() bool

func (*Config) IsNotBranch

func (c *Config) IsNotBranch() bool

func (*Config) IsNotLeaf

func (c *Config) IsNotLeaf() bool

type ConfigFile

type ConfigFile struct {
	Environments_Dir            string "environments_dir"
	Base_Environment_Ext        string "base_environment_ext"
	Autogenerate_Comment        string "autogenerate_comment"
	Combined_Vals_File          string "combined_vals_file"
	Combined_Vars_File          string "combined_vars_file"
	Combined_Derived_Vals_File  string "combined_derived_vals_file"
	Combined_Derived_Vars_File  string "combined_derived_vars_file"
	Combined_Tf_File            string "combined_tf_file"
	Combined_Remote_Config_File string "combined_remote_config_file"
	Remote_Config_File          string "remote_config_file"
	Derived_File                string "derived_file"
	Vals_File_Env_Post_String   string "vals_file_env_post_string"
	Branch_Order_File           string "branch_order_file"
}

func (*ConfigFile) ToYaml

func (c *ConfigFile) ToYaml(buf io.Writer) error

func (*ConfigFile) WriteToFile

func (c *ConfigFile) WriteToFile(filename string) error

type LoadConfigInput

type LoadConfigInput struct {
	// The environment
	Environment string
	// origin path where the command is run (typically cwd)
	OriginPath string
	// name for this template ie: vpc
	TmplName string
	// the difference between the cfg path and the root path.
	TmplPath string
	// path to config file
	CfgPath string
	// the root of the project (dir where config.yaml is)
	RootPath string
}

Jump to

Keyboard shortcuts

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