hummus 0.1.1-alpha
Pluggable configuration engine
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
hummus
Usage
Below is an example of how we can use a provider to fill up the values within a complex data structure:
struct X
{
private string p;
}
struct A
{
private int x, y;
private X z;
}
struct MinhaConfiguracao
{
private string adres;
private size_t porto;
private A s;
// private A si;
}
auto mc = MinhaConfiguracao();
auto ds = new DummySink();
fill(mc, ds);
writeln("Provider had requests for: ", ds._s.keys);
// show how the struct was filed
// up
writeln(mc);
assert(mc.porto == 443);
assert(mc.s.x == 10);
assert(mc.s.y == -10);
Right at the end we can see how all the values would
have been filled out when we did writeln(mc)
:
MinhaConfiguracao("v:adres", 443, A(10, -10, X("v:s.z.p")))
Development
Testing
In order to run the full test suite use the following command:
V=1 I__Z=2 dub test
The reason for the declaration of the environment
variables V=1 I__Z=2
is because onfe of the tests
is for the EnvironmentProvider
which searches
for environment variables, and in particular its
unittest looks for those two.
License
Licensed under the LGPL-2.0-only .
- 0.1.1-alpha released a day ago
- deavmi/hummus
- LGPL-2.0-only
- Copyright © 2025, Tristan Brice Velloza Kildaire
- Authors:
- Dependencies:
- niknaks
- Versions:
-
0.1.10-alpha 2025-Jun-30 0.1.9-alpha 2025-Jun-30 0.1.8-alpha 2025-Jun-30 0.1.7-alpha 2025-Jun-30 0.1.6-alpha 2025-Jun-30 - Download Stats:
-
-
12 downloads today
-
30 downloads this week
-
30 downloads this month
-
30 downloads total
-
- Score:
- 0.6
- Short URL:
- hummus.dub.pm