Skip to content
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

Implement initialization of configurations #150

Open
Waitak opened this issue Jan 2, 2016 · 1 comment
Open

Implement initialization of configurations #150

Waitak opened this issue Jan 2, 2016 · 1 comment

Comments

@Waitak
Copy link

Waitak commented Jan 2, 2016

Viper is great for flexibly handling configurations that are written by some outside means, but it does not provide a means of starting from scratch, nor does it provide the related ability to update a configuration from Go. It would be great to have an API method that, after constructing a configuration programatically, can write the configuration to a file in the desired format. Some issues to overcome:

  • If values were read in from several layers of configuration files (remote, /etc/..., ~/.config/..., ./...") then it's not obvious how to limit the values written to the file to only the ones explicitly set.
  • It would probably also be necessary to note if any values have been changed since they were read. GIven the hierarchical nature of configuration sources, this is also not obvious.

Still, it seems like a generally sufficiently useful function to be worth considering.

@doublerebel
Copy link

This looks like a dup of #145, also #153 would cover exporting the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants