Documentation ¶
Index ¶
- Constants
- func CalculateClusterWideUID(obj runtime.Object) types.UID
- func FormatKubeConfig(restConfig *clientrest.Config) clientcmdapi.Config
- func NewDefaultTableConverter(gr schema.GroupResource) rest.TableConvertor
- func NewTableConverter(gr schema.GroupResource, columns []metav1.TableColumnDefinition, ...) rest.TableConvertor
- type GrafanaResourceMetaAccessor
- type ResourceOriginInfo
Constants ¶
const AnnoKeyCreatedBy = "grafana.app/createdBy"
const AnnoKeyFolder = "grafana.app/folder"
const AnnoKeyOriginKey = "grafana.app/originKey"
const AnnoKeyOriginName = "grafana.app/originName"
const AnnoKeyOriginPath = "grafana.app/originPath"
const AnnoKeyOriginTimestamp = "grafana.app/originTimestamp"
const AnnoKeySlug = "grafana.app/slug"
const AnnoKeyUpdatedBy = "grafana.app/updatedBy"
const AnnoKeyUpdatedTimestamp = "grafana.app/updatedTimestamp"
Variables ¶
This section is empty.
Functions ¶
func CalculateClusterWideUID ¶
Create a stable UID that will be unique across a multi-tenant cluster This is useful while we migrate from SQL storage to something where the UID (GUID) is actually baked into the storage engine itself.
func FormatKubeConfig ¶
func FormatKubeConfig(restConfig *clientrest.Config) clientcmdapi.Config
func NewDefaultTableConverter ¶
func NewDefaultTableConverter(gr schema.GroupResource) rest.TableConvertor
func NewTableConverter ¶
func NewTableConverter(gr schema.GroupResource, columns []metav1.TableColumnDefinition, reader func(obj any) ([]interface{}, error)) rest.TableConvertor
Types ¶
type GrafanaResourceMetaAccessor ¶
type GrafanaResourceMetaAccessor interface { GetUpdatedTimestamp() (*time.Time, error) SetUpdatedTimestamp(v *time.Time) SetUpdatedTimestampMillis(unix int64) GetCreatedBy() string SetCreatedBy(user string) GetUpdatedBy() string SetUpdatedBy(user string) GetFolder() string SetFolder(uid string) GetSlug() string SetSlug(v string) GetOriginInfo() (*ResourceOriginInfo, error) SetOriginInfo(info *ResourceOriginInfo) GetOriginName() string GetOriginPath() string GetOriginKey() string GetOriginTimestamp() (*time.Time, error) // Find a title in the object // This will reflect the object and try to get: // * spec.title // * spec.name // * title // and return an empty string if nothing was found FindTitle(defaultTitle string) string }
Accessor functions for k8s objects
func MetaAccessor ¶
func MetaAccessor(raw interface{}) (GrafanaResourceMetaAccessor, error)
Accessor takes an arbitrary object pointer and returns meta.Interface. obj must be a pointer to an API type. An error is returned if the minimum required fields are missing. Fields that are not required return the default value and are a no-op if set.
type ResourceOriginInfo ¶
type ResourceOriginInfo struct { // Name of the origin/provisioning source Name string `json:"name,omitempty"` // The path within the named origin above (external_id in the existing dashboard provisioing) Path string `json:"path,omitempty"` // Verification/identification key (check_sum in existing dashboard provisioning) Key string `json:"key,omitempty"` // Origin modification timestamp when the resource was saved // This will be before the resource updated time Timestamp *time.Time `json:"time,omitempty"` // contains filtered or unexported fields }
ResourceOriginInfo is saved in annotations. This is used to identify where the resource came from This object can model the same data as our existing provisioning table or a more general git sync