Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ObjectNameRegex is the regular expression used to validate the object IDs. ObjectNameRegex = regexp.MustCompile("^[a-zA-Z0-9/_-]{2,64}$") // RelationNameRegex is the regular expression used to validate the names of relations. RelationNameRegex = regexp.MustCompile(fmt.Sprintf(`^(\.\.\.|%s)$`, identifier)) // NamespaceRegex is the regular expression used to validate namespace names. NamespaceRegex = regexp.MustCompile(fmt.Sprintf("^(%s/)?%s$", identifier, identifier)) // NamespaceRegex is the regular expression used to validate namespace names // that require tenant slugs. NamespaceWithTenantRegex = regexp.MustCompile(fmt.Sprintf("^(%s)/(%s)$", identifier, identifier)) ErrInvalidObjectName = errors.New("invalid object name") ErrInvalidRelationName = errors.New("invalid relation name") ErrInvalidNamespaceName = errors.New("invalid namespace name") )
Functions ¶
func NamespaceName ¶
NamespaceName validates that the string provided is a valid namespace name.
func NamespaceNameWithTenant ¶
NamespaceNameWithTenant validates that the string provided is a valid namespace name and contains a tenant component.
func ObjectName ¶
ObjectName validates that the string provided is a valid object name.
func RelationName ¶
RelationName validates that the string provided is a valid relation name.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.