config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfig = errors.New("invalid config")

Functions

This section is empty.

Types

type Apply

type Apply struct {
	RequireApprovals int `yaml:"require_approvals"`
}

func (*Apply) GetRequireApprovals

func (a *Apply) GetRequireApprovals() int

type Config

type Config struct {
	Version  int        `yaml:"version" validate:"oneof=1"`
	Projects []*Project `yaml:"projects" validate:"required,dive,required"`
	// contains filtered or unexported fields
}

func Load

func Load(filePath string, opts ...Option) (*Config, error)

func (*Config) GetProject

func (c *Config) GetProject(name string) *Project

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(any) error) error

func (*Config) Validate

func (c *Config) Validate() error

type Option

type Option func(o *options)

func WithDefaultTerraformVersion

func WithDefaultTerraformVersion(version string) Option

type Plan

type Plan struct {
	Paths []string `yaml:"paths" validate:"required,gt=0,dive,required"`
	Auto  bool     `yaml:"auto"`
}

func (*Plan) HasMatchedPaths

func (p *Plan) HasMatchedPaths(baseDir string, files []string) bool

type Project

type Project struct {
	Name           string     `yaml:"name" validate:"required"`
	Dir            string     `yaml:"dir" validate:"required"`
	Workspace      string     `yaml:"workspace"`
	Terraform      *Terraform `yaml:"terraform"`
	Plan           *Plan      `yaml:"plan" validate:"required"`
	Apply          *Apply     `yaml:"apply"`
	LockLabelColor string     `yaml:"lock_label_color"`
}

func (*Project) HasModifiedFiles added in v0.0.5

func (p *Project) HasModifiedFiles(files []string) bool

type Projects

type Projects []*Project

type Terraform

type Terraform struct {
	Version           string            `yaml:"version"`
	ExecPath          string            `yaml:"exec_path"`
	Vars              []string          `yaml:"vars"`
	VarFiles          []string          `yaml:"var_files"`
	BackendConfigPath string            `yaml:"backend_config_path"`
	BackendConfig     map[string]string `yaml:"backend_config"`
}

func (*Terraform) GetBackendConfig

func (t *Terraform) GetBackendConfig() map[string]string

func (*Terraform) GetBackendConfigPath

func (t *Terraform) GetBackendConfigPath() string

func (*Terraform) GetExecPath

func (t *Terraform) GetExecPath() string

func (*Terraform) GetVarFiles

func (t *Terraform) GetVarFiles() []string

func (*Terraform) GetVars

func (t *Terraform) GetVars() []string

func (*Terraform) GetVersion

func (t *Terraform) GetVersion() string

Jump to

Keyboard shortcuts

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