Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load parses the environment into cfg and returns it, erroring if anything required is missing or malformed. Apps depend on this instead of the env library directly, so config parsing, and the underlying dependency, is controlled in one place. Fields tagged `secret:"true"` are read here like any other.
Required-ness is declared with the required tag, not the env library's required/notEmpty options (Load rejects those). A field tagged `required:"*"` must be set and non-empty in every environment; `required:"a,b"` only in environments a or b, named via WithEnvironment; and an untagged field is never required. So one Config describes every environment and each enforces only its own required fields.
Types ¶
type Option ¶
type Option func(*loadOptions)
Option configures Load.
func WithEnvironment ¶
WithEnvironment declares the environment cfg is being loaded for. A field tagged `required:"a,b"` is enforced only when environment is a or b; a field tagged `required:"*"` is enforced in every environment, including when no environment is given.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cli builds ultra's command tree and wires the domain services together.
|
Package cli builds ultra's command tree and wires the domain services together. |
|
cmd
|
|
|
gen-docs
command
Command gen-docs writes the ultra command reference as one markdown file per command into the target directory (docs/reference by default).
|
Command gen-docs writes the ultra command reference as one markdown file per command into the target directory (docs/reference by default). |
|
ultra
command
|
|
|
internal
|
|
|
appcheck
Package appcheck holds the per-app static check shared by the lint and validate domains.
|
Package appcheck holds the per-app static check shared by the lint and validate domains. |
|
compose
Package compose builds the single docker-compose override that forwards every app's resolved secrets into its container through app-namespaced launcher variables.
|
Package compose builds the single docker-compose override that forwards every app's resolved secrets into its container through app-namespaced launcher variables. |
|
configreader
Package configreader is the shared source of truth for which secrets each app declares: it reads apps' Config packages and reports their secret env-var names.
|
Package configreader is the shared source of truth for which secrets each app declares: it reads apps' Config packages and reports their secret env-var names. |
|
gen
Package gen is the generate domain: it writes a single names-only docker compose file covering every app, from the secret names each app's Config declares (read through the shared configreader).
|
Package gen is the generate domain: it writes a single names-only docker compose file covering every app, from the secret names each app's Config declares (read through the shared configreader). |
|
lint
Package lint is the lint domain: it statically checks that every required key an app declares will be provided, without constructing or parsing any value, so it runs where the real secret values aren't reachable.
|
Package lint is the lint domain: it statically checks that every required key an app declares will be provided, without constructing or parsing any value, so it runs where the real secret values aren't reachable. |
|
project
Package project models the repo layout the commands operate on: the root the compose file and app paths are anchored to, and where each app's config package lives.
|
Package project models the repo layout the commands operate on: the root the compose file and app paths are anchored to, and where each app's config package lives. |
|
resolve
Package resolve defines ultra's secret and config resolver interfaces, the registry backends register into, and the layering that lets an override resolver win over a base one.
|
Package resolve defines ultra's secret and config resolver interfaces, the registry backends register into, and the layering that lets an override resolver win over a base one. |
|
run
Package run is the run domain: it generates the combined names-only compose override into an ephemeral location, resolves each app's secrets, and execs a command with the launcher environment and COMPOSE_FILE set.
|
Package run is the run domain: it generates the combined names-only compose override into an ephemeral location, resolves each app's secrets, and execs a command with the launcher environment and COMPOSE_FILE set. |
|
scan
Package scan is the config-scanning domain: it reads an app's exported Config struct and reports the env-var fields it declares.
|
Package scan is the config-scanning domain: it reads an app's exported Config struct and reports the env-var fields it declares. |
|
validate
Package validate is the validate domain: it reconstructs the environment each app would boot with (its non-secret config plus its resolved scan) and loads the app's Config against it to check it parses.
|
Package validate is the validate domain: it reconstructs the environment each app would boot with (its non-secret config plus its resolved scan) and loads the app's Config against it to check it parses. |