Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateArgument ¶
ValidateArgument checks if the provided argument contains only alphanumeric characters, underscores, slashes, or hyphens.
Parameters:
- arg (string): The argument to validate.
Returns:
- bool: True if the argument is valid, otherwise false.
func ValidateModuleName ¶
ValidateModuleName checks if a module with the given name already exists in the specified directory.
The function constructs the expected file path for the module definition using the format "<directory>/<name>.yaml". It then checks if the file exists:
- If the file does not exist, the function returns nil (indicating the module name is available).
- If the file exists, it returns an error indicating that the module name is already taken.
- If an error occurs while checking the file, it is returned.
Returns nil if the module name is available, otherwise returns an error.
func ValidatePassword ¶
ValidatePassword checks if the given password meets basic validation criteria.
The function performs the following checks:
- Trims any leading and trailing whitespace.
- Ensures the password is not empty.
- Ensures the password is at least 6 characters long.
Returns an error if the password is invalid, otherwise returns nil.
func ValidateVersion ¶
ValidateVersion checks if the given module version is valid.
The function performs the following checks:
- Trims any leading and trailing whitespace.
- Ensures the version is not empty.
- Validates the version format using a predefined regex.
Returns nil if the version is valid, otherwise returns an error.
Types ¶
This section is empty.