Documentation
¶
Overview ¶
Package config provides unified configuration loading for epithet. It supports YAML, JSON, and CUE file formats using CUE as the underlying parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadAndUnifyPaths ¶
LoadAndUnifyPaths loads multiple config files and unifies them into a single CUE value. Supports glob patterns and mixed file types (.cue, .yaml, .yml, .json). Missing files are silently skipped. Returns error if files have conflicting values.
func LoadFromFile ¶
LoadFromFile loads configuration from a file or directory into the specified type.
For .cue files: Uses CUE's load.Instances to support CUE packages with imports and modules. For .yaml/.yml/.json files: Uses direct parsing for standalone data files. For directories: Loads all .cue files as a package (supports imports between files).
Examples:
cfg, err := LoadFromFile[PolicyRulesConfig]("policy.yaml")
cfg, err := LoadFromFile[PolicyRulesConfig]("./config") // loads .cue directory
func LoadValue ¶
LoadValue loads configuration from a file and returns a CUE value. This allows dynamic path-based lookups without requiring Go struct definitions.
For .cue files: Uses CUE's load.Instances to support CUE packages with imports and modules. For .yaml/.yml/.json files: Uses direct parsing for standalone data files. For directories: Loads all .cue files as a package (supports imports between files).
Types ¶
This section is empty.