MCPcopy Create free account
hub / github.com/Permify/permify / TypeToString

Function TypeToString

pkg/attribute/attribute.go:278–299  ·  view source on GitHub ↗

TypeToString function takes an AttributeType enum and converts it into a string.

(attributeType base.AttributeType)

Source from the content-addressed store, hash-verified

276
277// TypeToString function takes an AttributeType enum and converts it into a string.
278func 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.

Callers 2

ValidateAttributeFunction · 0.92
attribute_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected