promql: use explicit type declare instead of string. (#7716)
Signed-off-by: johncming <johncming@yahoo.com>
This commit is contained in:
parent
1c1b394e5e
commit
31929b83d5
|
@ -24,20 +24,20 @@ type ValueType string
|
||||||
|
|
||||||
// The valid value types.
|
// The valid value types.
|
||||||
const (
|
const (
|
||||||
ValueTypeNone = "none"
|
ValueTypeNone ValueType = "none"
|
||||||
ValueTypeVector = "vector"
|
ValueTypeVector ValueType = "vector"
|
||||||
ValueTypeScalar = "scalar"
|
ValueTypeScalar ValueType = "scalar"
|
||||||
ValueTypeMatrix = "matrix"
|
ValueTypeMatrix ValueType = "matrix"
|
||||||
ValueTypeString = "string"
|
ValueTypeString ValueType = "string"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DocumentedType returns the internal type to the equivalent
|
// DocumentedType returns the internal type to the equivalent
|
||||||
// user facing terminology as defined in the documentation.
|
// user facing terminology as defined in the documentation.
|
||||||
func DocumentedType(t ValueType) string {
|
func DocumentedType(t ValueType) string {
|
||||||
switch t {
|
switch t {
|
||||||
case "vector":
|
case ValueTypeVector:
|
||||||
return "instant vector"
|
return "instant vector"
|
||||||
case "matrix":
|
case ValueTypeMatrix:
|
||||||
return "range vector"
|
return "range vector"
|
||||||
default:
|
default:
|
||||||
return string(t)
|
return string(t)
|
||||||
|
|
Loading…
Reference in New Issue