Open uhthomas opened 10 months ago
Not a duplicate of https://github.com/cue-lang/cue/issues/1621 at all, but worth noting that they are both similar plaintext key-value config formats.
Also worth noting that with @myitcv we recently talked about writing a "gitconfig" encoder, even if it's not part of the main cuelang.org/go
Go module, to implement the ini-like format documented at https://git-scm.com/docs/git-config. It is used elsewhere besides just Git, like for example Gerrit's https://gerrit-review.googlesource.com/Documentation/config-project-config.html, which we need to maintain due to our use of GerritHub, and we'd like to export from CUE.
So perhaps the two encoders could share some code as well, given their similarity. Or perhaps using existing Go packages for ini and gitconfig formats separately would be better, it depends on what is out there.
Is your feature request related to a problem? Please describe.
Some applications, like Grafana, use ini files for configuration.
Describe the solution you'd like
It would be nice to have a new
encoding/ini
package for marshalling cue to ini.Describe alternatives you've considered
Additional context
The Grafana configuration in a Kubernetes config map is just plain text. The configuration could be represented with cue and encoded to ini.
https://github.com/uhthomas/automata/blob/92de44958bb7c7ac91ad693a09febffeeebd021c/k8s/unwind/grafana/config_map_list.cue#L43-L68