Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load loads the CUE configuration at the file or CUE package directory configFilePath. If the file does not exist, os.IsNotExist error is returned.
The schema for the user configuration is given in schema. Usually this will come from a CUE file embedded in the binary by the caller. If it's empty then any configuration data will be allowed.
The user configuration is first read and unified with the schema. Then if runtime is non-nil, it is used to fill in the field "runtime", thus providing the user configuration with any desired runtime values (e.g. environment variables).
Then the result is finalised (which applies any user-specified defaults), then unified with the CUE contained in the defaults argument. This allows the program to specify default values independently from the user.
The result is unmarshaled into the Go value pointed to by dest using cue.Value.Decode (similar to json.Unmarshal).
Types ¶
This section is empty.