playlist

package
v0.0.1-test Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lineage

func Lineage(lib thema.Library, opts ...thema.BindOption) (thema.Lineage, error)

Lineage returns the Thema lineage representing a Grafana playlist.

The lineage is the canonical specification of the current playlist schema, all prior schema versions, and the mappings that allow migration between schema versions.

Types

type Coremodel

type Coremodel struct {
	// contains filtered or unexported fields
}

Coremodel contains the foundational schema declaration for playlists. It implements coremodel.Interface.

func New

func New(lib thema.Library) (*Coremodel, error)

New returns a new instance of the playlist coremodel.

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 (*Coremodel) CurrentSchema

func (c *Coremodel) CurrentSchema() thema.Schema

CurrentSchema returns the current (latest) playlist Thema schema.

func (*Coremodel) GoType

func (c *Coremodel) GoType() interface{}

GoType returns a pointer to an empty Go struct that corresponds to the current Thema schema.

func (*Coremodel) Lineage

func (c *Coremodel) Lineage() thema.Lineage

Lineage returns the canonical playlist Lineage.

type Model

type Model struct {
	// Interval sets the time between switching views in a playlist.
	// FIXME: Is this based on a standardized format or what options are available? Can datemath be used?
	Interval string `json:"interval"`

	// The ordered list of items that the playlist will iterate over.
	Items *[]PlaylistItem `json:"items,omitempty"`

	// Name of the playlist.
	Name string `json:"name"`

	// Unique playlist identifier. Generated on creation, either by the
	// creator of the playlist of by the application.
	Uid string `json:"uid"`
}

Model is the Go representation of a playlist.

THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES. Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.

type PlaylistItem

type PlaylistItem struct {
	// Title is an unused property -- it will be removed in the future
	Title *string `json:"title,omitempty"`

	// Type of the item.
	Type PlaylistItemType `json:"type"`

	// Value depends on type and describes the playlist item.
	//
	//  - dashboard_by_id: The value is an internal numerical identifier set by Grafana. This
	//  is not portable as the numerical identifier is non-deterministic between different instances.
	//  Will be replaced by dashboard_by_uid in the future. (deprecated)
	//  - dashboard_by_tag: The value is a tag which is set on any number of dashboards. All
	//  dashboards behind the tag will be added to the playlist.
	//  - dashboard_by_uid: The value is the dashboard UID
	Value string `json:"value"`
}

PlaylistItem is the Go representation of a playlist.Item.

THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES. Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.

type PlaylistItemType

type PlaylistItemType string

Type of the item.

THIS TYPE IS INTENDED FOR INTERNAL USE BY THE GRAFANA BACKEND, AND IS SUBJECT TO BREAKING CHANGES. Equivalent Go types at stable import paths are provided in https://github.com/grafana/grok.

const (
	PlaylistItemTypeDashboardById PlaylistItemType = "dashboard_by_id"

	PlaylistItemTypeDashboardByTag PlaylistItemType = "dashboard_by_tag"

	PlaylistItemTypeDashboardByUid PlaylistItemType = "dashboard_by_uid"
)

Defines values for PlaylistItemType.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL