config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfig

func FindConfig() (string, error)

FindConfig searches for cidx TOML config files in common locations

Types

type Action

type Action struct {
	Description   string            `toml:"description"`
	Image         string            `toml:"image"`
	Command       string            `toml:"command"`
	Entrypoint    []string          `toml:"entrypoint"` // Override container entrypoint
	Workdir       string            `toml:"workdir"`
	Volumes       []string          `toml:"volumes"`
	Env           map[string]string `toml:"env"`
	AutoPush      bool              `toml:"auto_push"`
	PushTags      bool              `toml:"push_tags"`
	WatchWorkflow bool              `toml:"watch_workflow"`
}

Action represents an automated workflow configuration

type BranchConfig

type BranchConfig struct {
	StaleDays     int      `toml:"stale_days"`     // Days before a branch is considered stale (default: 30)
	NamingPattern string   `toml:"naming_pattern"` // Regex pattern for valid branch names
	AutoCleanup   bool     `toml:"auto_cleanup"`   // Cleanup merged branches after PR merge
	Protected     []string `toml:"protected"`      // Branches that should never be deleted
}

BranchConfig defines branch management settings

type Config

type Config struct {
	Phases    map[string]Phase                  `toml:",inline"`
	Pipelines map[string]Pipeline               `toml:"pipelines"`
	Actions   map[string]Action                 `toml:"actions"`
	Branch    BranchConfig                      `toml:"branch"`
	Overrides map[string]map[string]interface{} `toml:",inline"`
	Workspace string                            // Auto-detected or from env
}

Config represents the complete CIDX configuration

func Load

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

Load loads configuration from a TOML file

type ContainerConfig

type ContainerConfig struct {
	Name        string
	Phase       string
	Image       string
	Command     string
	Entrypoint  []string // Override container entrypoint
	Workdir     string
	Volumes     []string
	Env         map[string]string
	ConfigFiles []string
	Privileged  bool // Requires root privileges
}

ContainerConfig represents a fully resolved container configuration after merging preset + overrides

type Phase

type Phase struct {
	Containers []string `toml:"containers"`
}

Phase defines containers for a specific phase

type Pipeline

type Pipeline struct {
	Phases []string `toml:"phases"`
}

Pipeline defines a sequence of phases to execute

type ValidationResult

type ValidationResult struct {
	Valid    bool
	Errors   []string
	Warnings []string
}

ValidationResult contains validation results

func Validate

func Validate(cfg *Config) ValidationResult

Validate validates the configuration

Jump to

Keyboard shortcuts

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