-
Notifications
You must be signed in to change notification settings - Fork 236
Allow for weighting of config sources #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
config::merge(config::File::with_name("Settings").weight(10));
config::merge(config::Environment::with_prefix("rust").weight(5)); That feels fine. Interesting suggestion. I'll peg it to be added. |
Thinking more on this .. I don't like
config.merge_at(File::with_name("Settings"), 10);
config.merge(File::with_name("Settings")).with_weight(20); Thoughts? Any other ideas? |
I think that's fine. I'm trying to think of a situation where you'd really want to have multiple separate configs where the weight is actually associated with the sources you're merging from and drawing a blank. It's really down to the config using the source.
|
Are you still interested in this, @nugend ? |
I still think it's a worthwhile idea, but I don't have a practical application at the moment. |
chore(deps): update msrv to v1.65.0
Config::sources could be an ordered collection and the config sources themselves could have a weighting:
config::merge(config::Environment::with_prefix("rust")::with_weight(10));
The weight itself would be an arbitrary value, of course (and presumably the ordered collection would preserve insertion order within weighting).
The text was updated successfully, but these errors were encountered: