configurations/

directory
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT

README

configurations example

Shows how an operator routes per-deployment values to a library that declares a configuration, and how a composite remaps the alias for everything inside its call.

The stack defines two greet.say actions and two greeter.greeting composite call sites. The leaves and call sites that omit a meta key use the default alias; the others select the formal alias either directly with @configuration: or by remapping inside a composite with @configurations:.

Try it

go run ./cmd/unobin compile \
  -p examples/configurations/factory.ub \
  -o /tmp/configurations-build \
  --replace-unobin="$(pwd)" \
  --unobin-version=v0.0.0 \
  --build

cd /tmp/configurations-build
export UB_STATE_KEY="$(head -c 32 /dev/urandom | base64)"
./configurations plan --allow-version-mismatch \
  -c "${OLDPWD}/examples/configurations/dev.ub" \
  -o /tmp/plan.json
./configurations apply /tmp/plan.json
./configurations output

Expected output:

casual:      "hello: world"
casual-wrap: "hello: wrapped"
formal:      "Good day: world"
formal-wrap: "Good day: wrapped"

Failures

The plan-time validator catches misuse before any work happens:

  • Mistype an alias: @configuration: greet.formel produces @configuration greet.formel: alias not declared in configurations.
  • Drop a default entry: configurations.greet: missing default entry.
  • Cross-import remap: @configurations: { greet: aws.formal } produces @configurations.greet: right-hand side import "aws" must match the key.

Directories

Path Synopsis
Package greet is a small demonstration library that exists so examples and tests can exercise configuration routing.
Package greet is a small demonstration library that exists so examples and tests can exercise configuration routing.

Jump to

Keyboard shortcuts

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