config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MPL-2.0 Imports: 10 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
	OutputFile string `json:"output_file,omitempty"`
}

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"`
	ConfigFile string                      `json:"config_file"`
}

func ConfigFromContext

func ConfigFromContext(ctx context.Context) *Config

func Get

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

func Read

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

func (Config) Profile added in v0.5.0

func (c Config) Profile(profile string) string

func (Config) String

func (c Config) 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"`
	PostApplyChecks struct {
		Enabled  bool
		Commands []Command
	} `json:"post_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