Documentation
¶
Overview ¶
Package group provides validation functions for group names.
Group names are used to organize and categorize resources. This package ensures group names follow consistent naming conventions for compatibility across systems.
Name Validation ¶
Validate group names against naming rules:
if err := group.ValidateName("my-team"); err != nil {
// Handle invalid group name
}
Valid group names must:
- Be non-empty (not just whitespace)
- Contain only lowercase alphanumeric characters, underscores, dashes, and spaces
- Not contain null bytes
- Not have leading or trailing whitespace
- Not contain consecutive spaces
Examples ¶
Valid names:
"teamalpha" "team-alpha" "team_alpha_123" "team alpha"
Invalid names:
"" // empty "TeamAlpha" // uppercase "team@alpha" // special characters " teamalpha" // leading space "team alpha" // consecutive spaces
Package group provides validation functions for group names.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateName ¶
ValidateName validates that a group name only contains allowed characters: lowercase alphanumeric, underscore, dash, and space. It also enforces no leading/trailing/consecutive spaces and disallows null bytes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.