Open nxcc opened 1 year ago
I think this is a duplicate of https://github.com/cue-lang/cue/issues/607, but please let me know if you don't think that is the case.
This feature request is for the github.com/cue-exp/cueconfig
package. cueconfig has only one public function Load
, and there is no way to Load cue files from an fs.FS. By adding a second function like e.g. LoadFS
it would be possible. #607 is about handling this inside cue itself, when it's done, the implementation of LoadFS
, or whatever name makes sense to you, could be much simplified. However, I think it's not a duplicate.
Thanks for clarifying @nxcc. Lots of interest in the io/fs.FS
loading, and I read this too quickly.
Would this be considered a good first issue?
Is your feature request related to a problem? Please describe. In some situations it would be useful to be able to load cue config from an
fs.FS
instead of the local filesystem.Describe the solution you'd like A new function, e.g.
LoadFS
, similar to the existingLoad
could be added. It would accept an aditionalfs.FS
parameter which provides the filesystem to load cue config from.Describe alternatives you've considered I don't see any good alternative how to load from
fs.FS
.Additional context I've created a fork (https://github.com/nxcc/cueconfig) with a simple implementation that suits my need. I use it in cuegen. This allows
cuegen
to load configuration from several remote sources. I'm open for suggestions to improve the code and would be happy to create a pull request in thecueconfig
repo. Please let me know what you think.