Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONtoCUE ¶
JSONtoCUE attempts to decode the given []byte into a cue.Value, relying on the central Grafana cue.Context provided in this package.
The provided path argument determines the name given to the input bytes if later CUE operations (e.g. Thema validation) produce errors related to the returned cue.Value.
This is a convenience function for one-off JSON decoding. It's wasteful to call it repeatedly. Most use cases use cases should probably prefer making their own Thema/CUE decoders.
func LoadGrafanaInstancesWithThema ¶
func LoadGrafanaInstancesWithThema(path string, cueFS fs.FS, lib thema.Library, opts ...thema.BindOption) (thema.Lineage, error)
LoadGrafanaInstancesWithThema loads CUE files containing a lineage representing some Grafana core model schema. It is expected to be used when implementing a thema.LineageFactory.
This function primarily juggles paths to make CUE's loader happy. Provide the path from the grafana root to the directory containing the lineage.cue. The lineage.cue file must be the sole contents of the provided fs.FS.
More details on underlying behavior can be found in the docs for github.com/grafana/thema/load.InstancesWithThema.
TODO this approach is complicated and confusing, refactor to something understandable
func ProvideCUEContext ¶
ProvideCUEContext is a wire service provider of a central cue.Context.
func ProvideThemaLibrary ¶
ProvideThemaLibrary is a wire service provider of a central thema.Library.
Types ¶
This section is empty.