Documentation
¶
Index ¶
- Constants
- func CUERegistryOrDefault() string
- type Arch
- type Config
- type Env
- type Loader
- func (l *Loader) EvalDir(dir string) (cue.Value, error)
- func (l *Loader) EvalFile(path string) (cue.Value, error)
- func (l *Loader) EvalPaths(paths []string) ([]cue.Value, error)
- func (l *Loader) Load(dir string) ([]resource.Resource, error)
- func (l *Loader) LoadFile(path string) ([]resource.Resource, error)
- func (l *Loader) LoadPaths(paths []string) ([]resource.Resource, error)
- type LoaderOption
- type OS
Constants ¶
const ( DefaultConfigDir = "~/.config/tomei" DefaultDataDir = "~/.local/share/tomei" DefaultBinDir = "~/.local/bin" DefaultEnvDir = "~/.config/tomei" )
Default path constants
const ( // ConfigFileName is the name of the tomei config file that should be ignored when loading manifests. ConfigFileName = "config.cue" // TomeiModulePath is the CUE module path for the tomei module. TomeiModulePath = "tomei.terassyi.net@v0" // CUELanguageVersion is the CUE language version used by the tomei module. CUELanguageVersion = "v0.9.0" // EnvCUERegistry is the environment variable name for the CUE registry. EnvCUERegistry = "CUE_REGISTRY" // DefaultCUERegistry is the built-in CUE_REGISTRY mapping for tomei modules. // When CUE_REGISTRY is not set, this default is used to resolve // tomei.terassyi.net imports from the OCI registry on ghcr.io. DefaultCUERegistry = "tomei.terassyi.net=ghcr.io/terassyi" )
Variables ¶
This section is empty.
Functions ¶
func CUERegistryOrDefault ¶
func CUERegistryOrDefault() string
CUERegistryOrDefault returns the CUE_REGISTRY environment variable value, or DefaultCUERegistry if not set.
Types ¶
type Config ¶
type Config struct {
DataDir string `json:"dataDir"`
BinDir string `json:"binDir"`
EnvDir string `json:"envDir"`
}
Config represents tomei configuration.
func LoadConfig ¶
LoadConfig loads configuration from the config directory. Returns default config if config.cue doesn't exist or has no config block.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader loads and parses CUE configuration files.
func NewLoader ¶
func NewLoader(env *Env, opts ...LoaderOption) *Loader
NewLoader creates a new Loader with the given environment and options.
func (*Loader) EvalDir ¶
EvalDir evaluates CUE files in a directory and returns the unified cue.Value without parsing into resource types. Used by tomei cue eval/export.
func (*Loader) EvalFile ¶
EvalFile evaluates a single CUE file and returns the cue.Value without parsing into resource types. Used by tomei cue eval/export.
func (*Loader) EvalPaths ¶
EvalPaths evaluates multiple files or directories and returns a slice of cue.Values. Each path produces one cue.Value. Used by tomei cue eval/export.
func (*Loader) Load ¶
Load loads CUE configuration from the given directory. config.cue files are excluded from loading as they contain tomei configuration, not manifests.
func (*Loader) LoadFile ¶
LoadFile loads a single CUE file. If the file is config.cue, it is skipped and returns empty resources. Files with a package declaration use load.Instances() so that import statements are resolved. Files without a package declaration use CompileString() (import is not available without a package).
type LoaderOption ¶
type LoaderOption func(*Loader)
LoaderOption configures a Loader.
func WithVerifier ¶
func WithVerifier(v verify.Verifier) LoaderOption
WithVerifier sets the cosign signature verifier for CUE module dependencies. When set, the Loader verifies first-party module signatures before CUE evaluation.