config

package
v0.0.0-...-4a57d31 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigName = "mx.yaml"

Variables

This section is empty.

Functions

func Discover

func Discover(explicit string) (string, error)

Discover finds the config file path. Priority: explicit path, cwd, parent walk.

Types

type Config

type Config struct {
	Use             string            `yaml:"use,omitempty"`
	Type            string            `yaml:"type,omitempty"`
	ParallelTargets bool              `yaml:"parallel_targets,omitempty"`
	Defaults        Defaults          `yaml:"defaults,omitempty"`
	Makefile        SourceConfig      `yaml:"makefile,omitempty"`
	Gitlab          SourceConfig      `yaml:"gitlab,omitempty"`
	Jobs            map[string]JobDef `yaml:"jobs"`

	// Set during loading, not from YAML.
	Dir string `yaml:"-"`
}

func Load

func Load(path string) (*Config, error)

Load reads and parses a config file. Does not resolve external sources.

func (*Config) HasExternalSource

func (c *Config) HasExternalSource() bool

HasExternalSource returns true if the config references an external source.

func (*Config) SourceType

func (c *Config) SourceType() string

SourceType returns the inferred or explicit source type.

type Defaults

type Defaults struct {
	Timeout     Duration `yaml:"timeout,omitempty"`
	GracePeriod Duration `yaml:"grace_period,omitempty"`
}

type Duration

type Duration struct {
	time.Duration
}

Duration wraps time.Duration for YAML unmarshaling from strings like "10m".

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() (interface{}, error)

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(value *yaml.Node) error

type JobDef

type JobDef struct {
	Run          string            `yaml:"run,omitempty"`
	Needs        []string          `yaml:"needs,omitempty"`
	Matrix       *MatrixDef        `yaml:"matrix,omitempty"`
	Targets      string            `yaml:"targets,omitempty"`
	Env          map[string]string `yaml:"env,omitempty"`
	Timeout      Duration          `yaml:"timeout,omitempty"`
	MaxParallel  int               `yaml:"max_parallel,omitempty"`
	AllowFailure bool              `yaml:"allow_failure,omitempty"`
	Description  string            `yaml:"-"`
}

type MatrixDef

type MatrixDef struct {
	Dimensions map[string][]string `yaml:"-"`
	Exclude    []map[string]string `yaml:"-"`
}

func (*MatrixDef) UnmarshalYAML

func (m *MatrixDef) UnmarshalYAML(value *yaml.Node) error

type SourceConfig

type SourceConfig struct {
	Cwd string `yaml:"cwd,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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