Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOutsideHome = errors.New("path is outside home directory")
ErrOutsideHome is returned by Register when a file resolves to a path outside the user's home directory. Callers use it to surface a clear user-facing error.
Functions ¶
func ContainWithinHome ¶
ContainWithinHome reports whether child is strictly inside home. When it is, it returns child rebuilt with home's exact casing on the prefix, so derived relative paths and map keys stay stable no matter how child was cased (e.g. a lowercase Windows drive letter, or macOS symlink resolution that preserves input casing). The containment test folds case on case-insensitive platforms and is exact on case-sensitive ones (Linux).
Types ¶
type File ¶
type File struct {
Token string
AbsPath string
RelPath string
Name string
// contains filtered or unexported fields
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManagerWithHome ¶
Click to show internal directories.
Click to hide internal directories.