Text Variable builder

The Text Variable builder helps creating text variables in the format expected by Perses.

Usage

package myDaC

import (
	textVarBuilder "github.com/perses/perses/cue/dac-utils/variable/text"
)

textVarBuilder & {} // input parameters expected

Parameters

ParameterTypeMandatory/OptionalDefaultDescription
#namestringMandatoryThe name of this variable.
#displayDisplayOptionalDisplay object to tune the display name, description and visibility (show/hide).
#valuestringMandatoryThe value of this variable.
#constantboolMandatoryfalseWhether this variable is a constant.

Output

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

Example

package myDaC

import (
	textVarBuilder "github.com/perses/perses/cue/dac-utils/variable/text"
)

{textVarBuilder & {
	#name:     "prometheus"
	#value:    "platform"
	#constant: true
}}.variable