cfg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEnv

func ApplyEnv(c *CellConfig, getenv func(string) string)

ApplyEnv overrides scalar fields from environment variables.

Types

type CellConfig

type CellConfig struct {
	Cell     CellSection
	Env      map[string]string
	Volumes  []VolumeMount
	Packages PackagesSection
}

CellConfig is the merged configuration from all TOML layers.

func LoadFile

func LoadFile(path string) (CellConfig, error)

LoadFile parses a TOML file into CellConfig. Returns zero value + nil error if the file does not exist.

func LoadFromOS

func LoadFromOS(configDir, cwd string) CellConfig

LoadFromOS loads the layered config using real XDG paths and os.Getenv.

func LoadLayered

func LoadLayered(globalPath, projectPath string, getenv func(string) string) CellConfig

LoadLayered loads global + project files, merges them, then applies env overrides.

func Merge

func Merge(global, project CellConfig) CellConfig

Merge returns a new CellConfig with project overriding global for scalars; Env maps and Volumes slices are accumulated (project wins on key conflict).

type CellSection

type CellSection struct {
	ImageTag string `toml:"image_tag"`
	GUI      bool   `toml:"gui"`
}

CellSection holds [cell] config.

type PackagesSection

type PackagesSection struct {
	Npm    map[string]string `toml:"npm"`
	Python map[string]string `toml:"python"`
}

PackagesSection holds [packages] config for npm and python tools.

type VolumeMount

type VolumeMount struct {
	Mount string `toml:"mount"`
}

VolumeMount holds a single [[volumes]] entry.

Jump to

Keyboard shortcuts

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