ValueMap🔗
Maps text values to a color or different display text and color.
For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
Definition🔗
type ValueMap struct {
Type string `json:"type"`
// Map with <value_to_match>: ValueMappingResult. For example: { "10": { text: "Perfection!", color: "green" } }
Options map[string]dashboard.ValueMappingResult `json:"options"`
}
Methods🔗
UnmarshalJSONStrict🔗
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode ValueMap
from JSON.
Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …
Equals🔗
Equals tests the equality of two ValueMap
objects.
Validate🔗
Validate checks all the validation constraints that may be defined on ValueMap
fields for violations and returns them.