coremodels: Update to latest Thema with generics (#56602)

* Update thema to latest

* Deal with s/Library/*Runtime/

* Commit new, working results of codegen
This commit is contained in:
sam boyer
2022-10-11 09:45:07 +01:00
committed by GitHub
parent 668cb25b82
commit e5a6547a94
26 changed files with 171 additions and 247 deletions
+4 -4
View File
@@ -560,8 +560,8 @@ var currentVersion = thema.SV(0, 0)
// The lineage is the canonical specification of the current pluginmeta schema,
// all prior schema versions, and the mappings that allow migration between
// schema versions.
func Lineage(lib thema.Library, opts ...thema.BindOption) (thema.Lineage, error) {
return cuectx.LoadGrafanaInstancesWithThema(filepath.Join("pkg", "coremodel", "pluginmeta"), cueFS, lib, opts...)
func Lineage(rt *thema.Runtime, opts ...thema.BindOption) (thema.Lineage, error) {
return cuectx.LoadGrafanaInstancesWithThema(filepath.Join("pkg", "coremodel", "pluginmeta"), cueFS, rt, opts...)
}
var _ thema.LineageFactory = Lineage
@@ -594,8 +594,8 @@ func (c *Coremodel) GoType() interface{} {
// Note that this function does not cache, and initially loading a Thema lineage
// can be expensive. As such, the Grafana backend should prefer to access this
// coremodel through a registry (pkg/framework/coremodel/registry), which does cache.
func New(lib thema.Library) (*Coremodel, error) {
lin, err := Lineage(lib)
func New(rt *thema.Runtime) (*Coremodel, error) {
lin, err := Lineage(rt)
if err != nil {
return nil, err
}