Documentation
¶
Index ¶
- func CleanText(text string) string
- func DebugLogf(format string, args ...interface{})
- func DebugPrintf(format string, args ...interface{})
- func ExpandPath(path string) (string, error)
- func ExtractSlugFromURL(urlStr string) string
- func GenerateSlug(text string) string
- func GetFloat32(m map[string]interface{}, key string) float32
- func GetInt(m map[string]interface{}, key string) int
- func GetString(m map[string]interface{}, key string) string
- func IsDebugEnabled() bool
- func SecureCommand(name string, args ...string) (*exec.Cmd, error)
- func SecureJoin(base string, elem ...string) (string, error)
- func ValidateBranch(branch string) error
- func ValidatePath(path string) error
- func ValidateRepository(repo string) error
- func ValidateScriptPath(scriptPath string) error
- type FileManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugLogf ¶
func DebugLogf(format string, args ...interface{})
DebugLogf logs a debug message only if DEBUG environment variable is enabled
func DebugPrintf ¶
func DebugPrintf(format string, args ...interface{})
DebugPrintf prints a debug message only if DEBUG environment variable is enabled
func ExpandPath ¶
ExpandPath safely expands ~ to home directory
func ExtractSlugFromURL ¶
ExtractSlugFromURL extracts a slug from a URL path
func GenerateSlug ¶
GenerateSlug converts text to a URL-friendly slug
func GetFloat32 ¶
GetFloat32 safely extracts a float32 value from a map
func IsDebugEnabled ¶
func IsDebugEnabled() bool
IsDebugEnabled returns true if DEBUG environment variable is set to true, 1, or yes (case-insensitive)
func SecureCommand ¶
SecureCommand creates a secure exec.Cmd with validated arguments
func SecureJoin ¶
SecureJoin safely joins path components and validates the result
func ValidateBranch ¶
ValidateBranch validates git branch names
func ValidatePath ¶
ValidatePath checks for path traversal attacks and validates path format
func ValidateRepository ¶
ValidateRepository validates repository names to prevent injection
func ValidateScriptPath ¶
ValidateScriptPath validates that script paths are in allowed directories
Types ¶
type FileManager ¶
type FileManager struct{}
FileManager provides secure file operations
func NewFileManager ¶
func NewFileManager() *FileManager
NewFileManager creates a new FileManager instance
func (*FileManager) Copy ¶
func (fm *FileManager) Copy(src, dst string) error
Copy safely copies a file from src to dst with validation
func (*FileManager) Remove ¶
func (fm *FileManager) Remove(path string) error
Remove safely removes a file or directory