Static List Variable CUE SDK

This library helps creating static list variables in the format expected by Perses.

Usage#

package myDaC

import (
	staticListVarBuilder "github.com/perses/plugins/staticlistvariable/sdk/cue:staticlist"
)

staticListVarBuilder & {} // input parameters expected

Parameters#

ParameterTypeMandatory/OptionalDefaultDescription
#namestringMandatoryThe name of this variable.
#values[...(string | { value: string, label?: string })]MandatoryThe list of values of this variable.
#displayDisplayOptionalDisplay object to tune the display name, description and visibility (show/hide).
#allowAllValuebooleanOptionalfalseWhether to append the "All" value to the list.
#allowMultiplebooleanOptionalfalseWhether to allow multi-selection of values.
#customAllValuestringOptionalCustom value that will be used if #allowAllValue is true and if All is selected.
#capturingRegexpstringOptionalRegexp used to catch and filter the results of the query. If empty, then nothing is filtered (equivalent of setting it to (.*)).
#sortSortOptionalSort method to apply when rendering the list of values.

Output#

FieldTypeDescription
variableVariableThe final variable object, to be passed to the dashboard.

Example#

package myDaC

import (
	staticListVarBuilder "github.com/perses/plugins/staticlistvariable/sdk/cue:staticlist"
)

{staticListVarBuilder & {
	#name:     "prometheus"
	#values:   ["one", "two", {value: "three", label: "THREE" }]
}}.variable