smartconfig/test/config.yaml
sneak 3c3732f033 Add JSON5 support, --json CLI flag, typed getters, and improve YAML quoting
- Updated JSON resolver to use gjson library for JSON5 support (comments, trailing commas)
- Added --json flag to CLI tool for JSON output format
- Added typed getter methods: GetInt(), GetUint(), GetFloat(), GetBool(), GetBytes()
- GetBytes() supports human-readable formats like "10G", "20KiB" via go-humanize
- Fixed YAML interpolation to always quote output values for safety
- Updated README to clarify YAML-only input and automatic quoting behavior
- Added .gitignore to exclude compiled binary
- Fixed test config files to use unquoted interpolation syntax
- Updated tests to expect quoted interpolation output
2025-07-21 12:13:14 +02:00

25 lines
545 B
YAML

name: ${ENV:TEST_APP_NAME}
host: ${EXEC:echo "test-host"}
port: ${ENV:TEST_PORT}
server:
hostname: ${EXEC:hostname}
machine:
id: ${FILE:./test/machine-id}
cores: ${EXEC:echo 4}
api:
endpoint: ${JSON:./test/hosts.json:api_endpoints.primary}
tls_host: ${JSON:./test/hosts.json:tls_sni_host.0}
database:
host: ${YAML:./test/data.yaml:'.database.host'}
version: ${YAML:./test/data.yaml:'.version'}
nested:
value: ${ENV:NESTED_${ENV:TEST_ENV_SUFFIX}}
env:
INJECTED_VAR: "injected-value"
COMPUTED_VAR: ${EXEC:echo computed}