TypeToString function takes an AttributeType enum and converts it into a string.
(attributeType base.AttributeType)
| 276 | |
| 277 | // TypeToString function takes an AttributeType enum and converts it into a string. |
| 278 | func TypeToString(attributeType base.AttributeType) string { |
| 279 | switch attributeType { |
| 280 | case base.AttributeType_ATTRIBUTE_TYPE_INTEGER: |
| 281 | return "integer" |
| 282 | case base.AttributeType_ATTRIBUTE_TYPE_INTEGER_ARRAY: |
| 283 | return "integer[]" |
| 284 | case base.AttributeType_ATTRIBUTE_TYPE_DOUBLE: |
| 285 | return "double" |
| 286 | case base.AttributeType_ATTRIBUTE_TYPE_DOUBLE_ARRAY: |
| 287 | return "double[]" |
| 288 | case base.AttributeType_ATTRIBUTE_TYPE_STRING: |
| 289 | return "string" |
| 290 | case base.AttributeType_ATTRIBUTE_TYPE_STRING_ARRAY: |
| 291 | return "string[]" |
| 292 | case base.AttributeType_ATTRIBUTE_TYPE_BOOLEAN: |
| 293 | return "boolean" |
| 294 | case base.AttributeType_ATTRIBUTE_TYPE_BOOLEAN_ARRAY: |
| 295 | return "boolean[]" |
| 296 | default: |
| 297 | return "undefined" |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | // ValidateValue checks the validity of the 'any' parameter which is a protobuf 'Any' type, |
| 302 | // based on the attribute type provided. |
no outgoing calls
no test coverage detected