Documentation
¶
Overview ¶
Package contract models notenv.toml, the committed contract declaring which env vars a project needs. It contains no values.
Index ¶
Constants ¶
const FileName = "notenv.toml"
Variables ¶
var ErrNotFound = errors.New("no " + FileName + " found (run `notenv init` in your project root)")
ErrNotFound is returned by Find when no notenv.toml exists between the start directory and the filesystem root.
var NamespaceName = regexp.MustCompile(`^[A-Za-z0-9_][A-Za-z0-9._-]*$`)
NamespaceName constrains namespaces: they become remote object names. Must start with an alphanumeric or underscore, which excludes the path-significant names "." and ".." (and any leading "-"), while still allowing dots/dashes internally.
Functions ¶
Types ¶
type File ¶
func Find ¶
Find walks up from start to the filesystem root looking for notenv.toml (like git does for .git) and parses the first one found. Returns the parsed file and the directory containing it.
func (*File) BuildEnv ¶
BuildEnv appends the contract's env vars (resolved from secrets) to base. Missing required secrets are an error; missing optional ones are skipped. os/exec deduplicates by key with last-wins, so appending overrides base.
func (*File) StorageKey ¶
StorageKey maps an env var name to the key it is stored under.