Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/cue-exp/cueconfig
- Owner: cue-exp
- License: apache-2.0
- Created: 2022-09-16T08:57:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-24T04:52:18.000Z (12 months ago)
- Last Synced: 2024-06-21T14:12:29.737Z (5 months ago)
- Language: Go
- Homepage:
- Size: 21.5 KB
- Stars: 17
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cue - cueconfig - Use CUE to configure your Go programs. (Projects)
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.