Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cue-exp/cueconfig

Package cueconfig provides an API designed to make it straightforward to use the CUE language as a configuration format for Go programs.
https://github.com/cue-exp/cueconfig

Last synced: 3 months ago
JSON representation

Package cueconfig provides an API designed to make it straightforward to use the CUE language as a configuration format for Go programs.

Awesome Lists containing this project

README

        

# cueconfig: use CUE to configure your Go programs

Package `cueconfig` provides an API designed to make it straightforward
to use the [CUE language](https://cuelang.org) as a configuration format
for Go programs.

It provides a single entry point, [Load](https://pkg.go.dev/github.com/cue-exp/cueconfig#Load), which is very roughly equivalent to [json.Unmarshal](https://pkg.go.dev/encoding/json#Unmarshal). It loads a configuration file (or directory) from disk and unmarshals it into a Go value.

Optionally, `Load` can be provided with a CUE schema to verify the configuration before unmarshaling into the Go value, a set of default values to apply after any user-specified defaults, and some runtime-defined values to be made available to the configuration.

There is a [full example](https://pkg.go.dev/github.com/cue-exp/cueconfig#example-Load) in the package documentation.

### Issue tracking

Please raise all issues in [the main CUE
repository](https://github.com/cue-lang/cue/issues), giving the title of the
issue a `cueconfig: ` prefix.