config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.New(os.Stderr, "", log.LstdFlags)

Functions

func NewConfigContext

func NewConfigContext(ctx context.Context, value *Config) context.Context

func SetDefaults added in v0.3.0

func SetDefaults(ctx context.Context, cfg *Config, filename string) error

Types

type Command

type Command struct {
	Name    string
	Command []string
	Files   []string
}

type Config

type Config struct {
	Config struct {
		DefaultTerraformProfile string `json:"default_terraform_profile"`
		TerraformProfileEnvVar  string `json:"terraform_profile_env_var"`
	} `json:"config"`
	TFProfile  map[string]TerraformProfile `json:"terraform_profile"`
	ConfigRoot string                      `json:"config_root"`
}

func ConfigFromContext

func ConfigFromContext(ctx context.Context) *Config

func Get

func Get(ctx context.Context, filename string) (*Config, string, error)

func Read

func Read(ctx context.Context, filename string, configFH io.Reader) (*Config, error)

func (Config) Profile added in v0.5.0

func (c Config) Profile(profile string) string

type TerraformProfile added in v0.3.0

type TerraformProfile struct {
	ID   string `json:"id"`
	Init struct {
		BackendConfig []string `json:"backend_config"`
	}
	Plan struct {
		VarFile []string `json:"var_file"`
	}
	Workspaces struct {
		Enabled bool
		Dir     string
	}
	PreApplyChecks struct {
		Enabled  bool
		Commands []Command
	} `json:"pre_apply_checks"`
	BinaryName string   `json:"binary_name"`
	Platforms  []string `json:"platforms"`
}

func (TerraformProfile) String added in v0.3.0

func (t TerraformProfile) String() string

Jump to

Keyboard shortcuts

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