envshield 0.0.4

Define a schema for your .env files.
Documentation
# Version must be set to "1"
version = "1"

# Here we define an environment variable with an expected value and (are required to) provide
# a description. This helps to self document the environment variables in a complex project.
[DOMAIN]
value = "https://example.com"
description = "The domain used by the application."

# Suggests that an environment variable must be present and provides a default for the user
# to use.
[LOG_LEVEL]
default = "warn"
description = "Which logging level the program uses [debug, warn or error]"

# With just a description it enforces that an environment variable is present, but doesn't
# enforce a value. Useful for secrets.
[API_KEY]
description = "Authentication key used only during local testing."

# Truly optional variables will not be enforced.
[RUST_BACKTRACE]
optional = true
description = "When set to 1, captures stack backtrace of an OS Thread"

# Values from other variables can be referenced using `{{ KEY }}` syntax.
[DATABASE_URL]
value = "{{ DOMAIN }}/api/database"
description = "Database URL used by the PG database."

[CARGO_REGISTRY_TOKEN]
description = "Used to publish this crate in CI"