Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidPath = errors.New("invalid path") ErrPathTooLong = errors.New("path too long") ErrPathTraversal = errors.New("path traversal attempt") )
Path security errors per AI.md PART 5
Functions ¶
func IsPrivileged ¶
func IsPrivileged() bool
IsPrivileged returns true if running with elevated privileges
func NormalizePath ¶
NormalizePath is a simple path normalizer (no validation) Use SafePath() for user input that needs validation
func SafeFilePath ¶
SafeFilePath ensures path stays within base directory Per AI.md PART 5 FILE PATH SECURITY (NON-NEGOTIABLE)
Types ¶
type Paths ¶
type Paths struct {
// Runtime paths
ConfigDir string
DataDir string
LogDir string
BackupDir string
PIDFile string
// Specific subdirectories
SSLDir string
SecurityDir string
DBDir string
}
Paths represents OS-specific paths for the application
func Get ¶
Get returns OS-specific paths based on OS and privilege level Per AI.md PART 4 OS-SPECIFIC PATHS (NON-NEGOTIABLE)
func (*Paths) EnsureDirs ¶
EnsureDirs creates all necessary directories
func (*Paths) GetConfigPath ¶
GetConfigPath returns the path to server.yml
Click to show internal directories.
Click to hide internal directories.