presets

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

View Source
var GlobalRegistry map[string]Preset

GlobalRegistry contains all built-in presets Loaded from presets.yaml (dev) or embedded data (production)

Functions

func Exists

func Exists(name string) bool

Exists checks if a preset exists

func GroupByPhase

func GroupByPhase() map[string][]string

GroupByPhase returns presets grouped by phase

func List

func List() []string

List returns all preset names

func ListByPhase

func ListByPhase(phase string) []string

ListByPhase returns presets filtered by phase

Types

type Option

type Option struct {
	Type        string      `yaml:"type" toml:"type"`                 // string, bool, int, array
	Default     interface{} `yaml:"default" toml:"default"`           // Default value
	Description string      `yaml:"description" toml:"description"`   // Help text
	EnvVar      string      `yaml:"env_var" toml:"env_var"`           // Maps to environment variable
	CommandFlag string      `yaml:"command_flag" toml:"command_flag"` // Maps to command flag
}

Option defines a configurable parameter for a preset

type OptionTOML

type OptionTOML struct {
	Type        string      `toml:"type"`
	Default     interface{} `toml:"default"`
	Description string      `toml:"description"`
	CommandFlag string      `toml:"command_flag"`
	EnvVar      string      `toml:"env_var"`
}

OptionTOML represents an option in TOML format

type Preset

type Preset struct {
	Name          string            `yaml:"name" toml:"name"`
	Phase         string            `yaml:"phase" toml:"phase"`
	Image         string            `yaml:"image" toml:"image"`
	Command       string            `yaml:"command" toml:"command"`
	Workdir       string            `yaml:"workdir" toml:"workdir"`
	Volumes       []string          `yaml:"volumes" toml:"volumes"`
	Env           map[string]string `yaml:"env" toml:"env"`
	ConfigFiles   []string          `yaml:"config_files" toml:"config_files"`
	Options       map[string]Option `yaml:"options" toml:"options"`
	RequireCI     bool              `yaml:"require_ci" toml:"require_ci"`                     // Requires CI environment
	LocalBehavior string            `yaml:"local_behavior" toml:"local_behavior"`             // draft, no-push, dry-run, disabled
	Privileged    bool              `yaml:"privileged,omitempty" toml:"privileged,omitempty"` // Requires root privileges (skip user mapping)
}

Preset defines a complete tool configuration with sensible defaults

func Get

func Get(name string) (Preset, error)

Get retrieves a preset by name

func (*Preset) MergeWith

func (p *Preset) MergeWith(overrides map[string]interface{}) *Preset

MergeWith merges user overrides into the preset

type PresetTOML

type PresetTOML struct {
	Name          string                `toml:"name"`
	Phase         string                `toml:"phase"`
	Image         string                `toml:"image"`
	Command       string                `toml:"command"`
	Workdir       string                `toml:"workdir"`
	Volumes       []string              `toml:"volumes"`
	Env           map[string]string     `toml:"env"`
	ConfigFiles   []string              `toml:"config_files"`
	Options       map[string]OptionTOML `toml:"options"`
	RequireCI     bool                  `toml:"require_ci"`
	LocalBehavior string                `toml:"local_behavior"`
	Privileged    bool                  `toml:"privileged"`
}

PresetTOML represents a preset in TOML format

type PresetsFile

type PresetsFile struct {
	Presets map[string]PresetTOML `toml:"presets"`
}

PresetsFile represents the structure of presets.toml

Jump to

Keyboard shortcuts

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