Utils Core Documentation
Provides low-level core utility functions for server management.
This module contains a collection of helper functions that perform specific,
atomic tasks related to server management. These utilities are designed to be
used by higher-level components like the BedrockServer
or API endpoints.
Key functions include:
core_validate_server_name_format()
: Validates server names against a regex.
- bedrock_server_manager.core.utils.core_validate_server_name_format(server_name: str) None
Validates the format of a server name against a specific pattern.
The function checks that the server name is not empty and contains only alphanumeric characters (a-z, A-Z, 0-9), hyphens (-), and underscores (_). This helps prevent issues with file paths and system commands.
- Parameters:
server_name (str) – The server name string to validate.
- Raises:
InvalidServerNameError – If the server name is empty or contains invalid characters.