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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user