config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(ctx context.Context, conf *Configuration) context.Context

Types

type Components

type Components struct {
	Terraform Terraform `yaml:"terraform" json:"terraform" mapstructure:"terraform"`
	Helmfile  Helmfile  `yaml:"helmfile" json:"helmfile" mapstructure:"helmfile"`
}

type Configuration

type Configuration struct {
	BasePath   string     `yaml:"base_path" json:"base_path" mapstructure:"base_path"`
	Components Components `yaml:"components" json:"components" mapstructure:"components"`
	Stacks     Stacks     `yaml:"stacks" json:"stacks" mapstructure:"stacks"`
	Workflows  Workflows  `yaml:"workflows" json:"workflows" mapstructure:"workflows"`
	Logs       Logs       `yaml:"logs" json:"logs" mapstructure:"logs"`
}

func GetConfig

func GetConfig(ctx context.Context) *Configuration

func InitConfig

func InitConfig() (*Configuration, error)

InitConfig finds and merges CLI configurations in the following order: system dir, home dir, current dir, ENV vars, command-line arguments https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63

type Helmfile

type Helmfile struct {
	BasePath           string            `yaml:"base_path" json:"base_path" mapstructure:"base_path"`
	KubeconfigPath     string            `yaml:"kubeconfig_path" json:"kubeconfig_path" mapstructure:"kubeconfig_path"`
	ClusterNamePattern string            `yaml:"cluster_name_pattern" json:"cluster_name_pattern" mapstructure:"cluster_name_pattern"`
	Envs               map[string]string `yaml:"envs" json:"envs" mapstructure:"envs"`
}

type Logs

type Logs struct {
	Level  string `yaml:"verbose" json:"verbose" mapstructure:"verbose"`
	Colors bool   `yaml:"colors" json:"colors" mapstructure:"colors"`
}

type Stacks

type Stacks struct {
	BasePath      string   `yaml:"base_path" json:"base_path" mapstructure:"base_path" validate:"required"`
	IncludedPaths []string `yaml:"included_paths" json:"included_paths" mapstructure:"included_paths" validate:"required"`
	ExcludedPaths []string `yaml:"excluded_paths" json:"excluded_paths" mapstructure:"excluded_paths"`
	NamePattern   string   `yaml:"name_pattern" json:"name_pattern" mapstructure:"name_pattern"`
}

type Terraform

type Terraform struct {
	BasePath                string `yaml:"base_path" json:"base_path" mapstructure:"base_path"`
	ApplyAutoApprove        bool   `yaml:"apply_auto_approve" json:"apply_auto_approve" mapstructure:"apply_auto_approve"`
	DeployRunInit           bool   `yaml:"deploy_run_init" json:"deploy_run_init" mapstructure:"deploy_run_init"`
	InitRunReconfigure      bool   `yaml:"init_run_reconfigure" json:"init_run_reconfigure" mapstructure:"init_run_reconfigure"`
	AutoGenerateBackendFile bool   `yaml:"auto_generate_backend_file" json:"auto_generate_backend_file" mapstructure:"auto_generate_backend_file"`
}

type Workflows

type Workflows struct {
	BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"`
}

Jump to

Keyboard shortcuts

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