mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 16:23:48 +08:00

* Add datasource info provider * Dashboards: Support schemaVersion v35 migration in backend * update go mods --------- Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com> Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com> Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
64 lines
1.5 KiB
Go
64 lines
1.5 KiB
Go
//
|
|
// This file is generated by grafana-app-sdk
|
|
// DO NOT EDIT
|
|
//
|
|
|
|
package apis
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/grafana/grafana-app-sdk/app"
|
|
"github.com/grafana/grafana-app-sdk/resource"
|
|
|
|
v0alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1"
|
|
v1beta1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
|
v2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
|
|
)
|
|
|
|
var appManifestData = app.ManifestData{
|
|
AppName: "dashboard",
|
|
Group: "dashboard.grafana.app",
|
|
Kinds: []app.ManifestKind{
|
|
{
|
|
Kind: "Dashboard",
|
|
Scope: "Namespaced",
|
|
Conversion: false,
|
|
Versions: []app.ManifestKindVersion{
|
|
{
|
|
Name: "v0alpha1",
|
|
},
|
|
|
|
{
|
|
Name: "v1beta1",
|
|
},
|
|
|
|
{
|
|
Name: "v2alpha1",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
func LocalManifest() app.Manifest {
|
|
return app.NewEmbeddedManifest(appManifestData)
|
|
}
|
|
|
|
func RemoteManifest() app.Manifest {
|
|
return app.NewAPIServerManifest("dashboard")
|
|
}
|
|
|
|
var kindVersionToGoType = map[string]resource.Kind{
|
|
"Dashboard/v0alpha1": v0alpha1.DashboardKind(),
|
|
"Dashboard/v1beta1": v1beta1.DashboardKind(),
|
|
"Dashboard/v2alpha1": v2alpha1.DashboardKind(),
|
|
}
|
|
|
|
// ManifestGoTypeAssociator returns the associated resource.Kind instance for a given Kind and Version, if one exists.
|
|
// If there is no association for the provided Kind and Version, exists will return false.
|
|
func ManifestGoTypeAssociator(kind, version string) (goType resource.Kind, exists bool) {
|
|
goType, exists = kindVersionToGoType[fmt.Sprintf("%s/%s", kind, version)]
|
|
return goType, exists
|
|
}
|