playlist

package
v0.0.0-cloud Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

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

	// Type of the item.
	Type ItemType `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"`
}

Item defines model for Item.

type ItemType

type ItemType string

Type of the item.

const (
	ItemTypeDashboardById  ItemType = "dashboard_by_id"
	ItemTypeDashboardByTag ItemType = "dashboard_by_tag"
	ItemTypeDashboardByUid ItemType = "dashboard_by_uid"
)

Defines values for ItemType.

type Kind

type Kind struct {
	kindsys.Core
	// contains filtered or unexported fields
}

TODO standard generated docs

func NewKind

func NewKind(rt *thema.Runtime, opts ...thema.BindOption) (*Kind, error)

TODO standard generated docs

func (*Kind) ConvergentLineage

func (k *Kind) ConvergentLineage() thema.ConvergentLineage[*Playlist]

ConvergentLineage returns the same thema.Lineage as Lineage, but bound (see thema.BindType) to the the Playlist type generated from the current schema, v0.0.

func (*Kind) JSONValueMux

func (k *Kind) JSONValueMux(b []byte) (*Playlist, thema.TranslationLacunas, error)

JSONValueMux is a version multiplexer that maps a []byte containing JSON data at any schematized dashboard version to an instance of Playlist.

Validation and translation errors emitted from this func will identify the input bytes as "dashboard.json".

This is a thin wrapper around Thema's vmux.ValueMux.

type Playlist

type Playlist 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.
	// FIXME! This should not be optional, but changing it makes the godegen awkward
	Items []Item `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"`
}

Playlist defines model for Playlist.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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