group

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

func ValidateName(name string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL