| Crates.io | snyk-config |
| lib.rs | snyk-config |
| version | 0.2.0 |
| created_at | 2019-11-10 22:14:56.06156+00 |
| updated_at | 2023-10-06 09:22:46.717751+00 |
| description | Opinionated JSON config loader |
| homepage | |
| repository | https://github.com/FauxFaux/snyk-config-rs |
| max_upload_size | |
| id | 180111 |
| size | 11,293 |
This is a port of @snyk/config,
an opinionated npm library which loads config from files and
the environment.
It prefers:
CONF_, as literals or JSON${CONFIG_SECRET_FILE}config.${SERVICE_ENV}.jsonconfig.default.jsonThe ${env_vars} referenced above also have defaults:
CONFIG_SECRET_FILE defaults to ./config.secret.jsonSERVICE_ENV defaults to localLoaded values are merged, e.g.
config.default.json:
{"buy": {"potatoes": 5}}
config.secret.json:
{"buy": {"condamns": 1}}
env:
export CONF_buy__condamns=7
export CONF_debug=true
..will result in:
{"buy": {"condamns": 7, "potatoes": 5}, "debug": true}