config

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidBinary added in v0.8.1

func IsValidBinary(binary string) bool

IsValidBinary reports whether binary is an allowed terraform/tofu binary value.

func IsValidTestEngine added in v0.8.1

func IsValidTestEngine(engine string) bool

IsValidTestEngine reports whether engine is an allowed test engine value.

func ValidBinaryNames added in v0.8.1

func ValidBinaryNames() []string

ValidBinaryNames returns the allowed terraform/tofu binary values.

func ValidTestEngineNames added in v0.8.1

func ValidTestEngineNames() []string

ValidTestEngineNames returns the allowed test engine values.

Types

type Config

type Config struct {
	Root        string                       `yaml:"root"`
	Binary      string                       `yaml:"binary"`
	Test        *TestConfig                  `yaml:"test"`
	Tasks       map[string]*tasks.TaskConfig `yaml:"tasks"`
	Parallelism *ParallelismConfig           `yaml:"parallelism"`
	ConfigPath  string                       `yaml:"-"` // Path to the config file, if found
}

Config represents the .motf.yml configuration file

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with default values

func Load

func Load(startDir string, configPath string) (*Config, error)

Load searches for .motf.yml starting from startDir and walking up the directory tree until it reaches the Git repository root. If configPath is provided, it loads that file directly.

type ParallelismConfig added in v0.8.0

type ParallelismConfig struct {
	MaxJobs int `yaml:"max_jobs"`
}

func (*ParallelismConfig) GetMaxJobs added in v0.8.0

func (p *ParallelismConfig) GetMaxJobs() int

GetMaxJobs returns the maximum number of parallel jobs to run. If MaxJobs is not set or is less than or equal to zero, it defaults to the number of CPU cores.

type TestConfig

type TestConfig struct {
	Engine string `yaml:"engine"`
	Args   string `yaml:"args"`
}

TestConfig represents the test configuration section

Jump to

Keyboard shortcuts

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