Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFromDisk ¶
LoadFromDisk Loads the content of the paths into the directory recursively
func WalkFileTree ¶
WalkFileTree iterates over each and every file instance found in the directory
Types ¶
type Directory ¶
type Directory interface { Name() (name paths.Path) AbsolutePath() (path paths.Path) WithPermission(permission os.FileMode) Directory PermissionSet() os.FileMode Files() (files []File) File(path paths.Path) (file File) NewFile(path paths.Path) (newFile File) DeleteFile(path paths.Path) Directories() (directories []Directory) Directory(path paths.Path) (directory Directory) NewDirectory(path paths.Path) (newDirectory Directory) DeleteDirectory(path paths.Path) Parent() (parentDirectory Directory) AsRoot() (rootDirectory Directory) }
Directory represents a virtual directory containing files.
Name return the name of the directory excluding the paths it is in ¶
Files returns the list of all files in the given directory ¶
File returns the file for the given name or nil ¶
NewFile creates a new File in the directory and returns the new instance ¶
Delete deletes the file stored under the given name ¶
Directories returns the directories stored under this directory ¶
Directory returns the directory with the given name or nil ¶
NewDirectory creates a new directory ¶
DeleteDirectory deletes a directory ¶
Parent returns the directory this directory is found in ¶
AsRoot creates a deep copy of the current directory, but with the current directory as it's root
func NewRootDirectory ¶
func NewRootDirectory() Directory
NewRootDirectory returns a new root directory
type File ¶
type File interface { Name() (name paths.Path) AbsolutePath() (path paths.Path) WithPermission(set os.FileMode) File PermissionSet() os.FileMode CopyContent(writer io.Writer) (e error) Write(reader io.Reader) (e error) WriteFlagged(reader io.Reader, append bool) (e error) Delete() Parent() (parentDirectory Directory) }
File represents a digital file object
Name returns the name of the file, excluding the paths it is stored in ¶
CopyContent stores the files binary content in the writer ¶
Write writes content to the file. The default will not append to the file
Delete deletes the file
Click to show internal directories.
Click to hide internal directories.