Help us shape the future of Go! Take the 2026 Go Developer Survey

chain

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package chain resolves Layer-1: the .cenvkit.envchain file list plus the "K=V" seed environment for the engine. Pure Go — imports no compose-go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	ProjectDir string                 // absolute project directory
	OSEnv      []string               // os.Environ(); injected for testability
	Hostname   func() (string, error) // injected; production passes os.Hostname
	Chain      string                 // named chain to select (C4); "" or "default" = the [default]/header-less section
}

Input describes one Layer-1 resolution request. OSEnv and Hostname are injected for testability; production passes os.Environ() and os.Hostname.

type Result

type Result struct {
	Files            []string // ordered absolute Layer-1 paths, existing only, deduped
	Vars             []string // merged "K=V" seed for the engine (OS env wins over file vars), sorted
	ComposeEnv       string   // resolved CENVKIT_ENV ("dev" default)
	ComposeEnvSource string   // where ComposeEnv came from: "shell" | ".env" | "default" (for the --overview header)
	Host             string   // resolved + sanitized host ([A-Za-z0-9._-])
}

Result is the resolved Layer-1 view.

func Resolve

func Resolve(in Input) (Result, error)

Resolve computes the Layer-1 file list and the seed environment.

type UnknownChainError

type UnknownChainError struct {
	Name      string   // the requested chain name
	Available []string // sorted section names actually present
}

UnknownChainError reports a requested --chain <name> that the chain file does not define. It carries the available section names (sorted) so the CLI can list them and exit 2.

func (*UnknownChainError) Error

func (e *UnknownChainError) Error() string

Jump to

Keyboard shortcuts

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