Crate viperus

Source
Expand description

viperus is an (in)complete configuration solution for Rust applications.

I have already said that it is incomplete? use at your own risk. ;-) viperus handle some types of configuration needs and formats.

  • setting defaults
  • reading from JSON, TOML, YAML, dotenv file ,java properties config files
  • reading from environment variables
  • reading from Clap command line flags
  • setting explicit values
  • reload of all files
  • whatch config files and reolad all in something changes
  • caching Viperus uses the following decreasing precedence order.
  • explicit call to add
  • clap flag
  • config
  • env variables
  • default

Macros§

path

Structs§

Map
Viperus
A unified config Facade

Enums§

Format
preconfigured file formats with stock adapters
ViperusError
ViperusValue
ViperusValue encaspule data values of type String,i32 and bool

Traits§

ConfigAdapter
ConfigAdapter mediates from varius config format and Viperus

Functions§

add
add an override value to the cofiguration
add_default
add an default value to the global cofiguration
automatic_env
whan enabled viperus will check for an environment variable any time Get request is made checking for a environment variable with a name matching the key uppercased and prefixed with the env_prefix if set.
bond_clap
bond a clap argsument to a config key
cache
cache the query results for small configs speedup is x4 from v 0.1.9 returns the previus state , useful for test setups.
get
get a configuration value of type T from global configuration in this order
load_adapter
load_adapter ask the adapter to parse her data and merges result map in the internal configurtion map of global instance
load_clap
load_clap brings in the clap magic
load_file
load_file load a config file in the global instance
reload
reload the configuration files
set_env_prefix
prepend ‘pefix’ when quering envirment variables
watch_all
Watch the config files and autoreload in case of change

Type Aliases§

AdapterResult