Documentation
¶
Overview ¶
Package validation provides input sanitization and validation utilities.
It includes functions for converting user-provided strings into safe values for use in filenames, paths, and other contexts where special characters could cause problems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSymlinks ¶ added in v0.6.0
CheckSymlinks checks whether dir itself or any of its immediate children are symlinks. Returns an error describing the first symlink found.
func SanitizeFilename ¶
SanitizeFilename converts a topic string to a safe filename component.
Replaces spaces and special characters with hyphens, converts to lowercase, and limits length to 50 characters. Returns "session" if the input is empty.
Parameters:
- s: Topic string to sanitize
Returns:
- string: Safe filename component (lowercase, hyphenated, max 50 chars)
func ValidateBoundary ¶ added in v0.6.0
ValidateBoundary checks that dir resolves to a path within the current working directory. Returns an error if the resolved path escapes the project root.
Types ¶
This section is empty.