https://github.com/lightbender/configd
Key/Value Configuration Library for D
https://github.com/lightbender/configd
Last synced: 6 months ago
JSON representation
Key/Value Configuration Library for D
- Host: GitHub
- URL: https://github.com/lightbender/configd
- Owner: LightBender
- License: bsl-1.0
- Created: 2016-12-06T08:54:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-08T04:05:28.000Z (over 9 years ago)
- Last Synced: 2025-01-23T18:52:44.320Z (over 1 year ago)
- Language: D
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# configd
configd is a D library that provides a unified storage and retrival API for application configuration information. The configd API is extensible and can support any configuration source that can be mapped to key/value pair.
## Configuration Providers
configd supports the following configuration providers:
- EnvironmentConfig - Loads the applications envirvonment variables under the '/env/' path.
- MemoryConfig - Allows the developer to specify configuration values in code.
- JsonConfig - Loads configuration information from the specified JSON file.
## Example Usage
```
import std.stdio;
import configd;
auto mem = new MemoryConfig("memory");
mem.set("test", "Hello World");
auto config = new Configuration()
.addJsonConfig("./config.json", "config");
.addMemoryConfig(mem);
.addEnvironmentConfig();
config.build();
auto envPath = config.get!string("/env/path");
writeln(envPath);
auto keys = config.listKeys();
foreach(k; keys)
writeln(k);
```