Documentation ¶
Overview ¶
Package filesystem provides concise data structures for filesystem operations and functions to apply them to local files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dir ¶
type Dir string
A Dir is a filesystem path to a directory from which to apply operations.
func (Dir) Apply ¶
Apply applies the sequence of filesystem operations given. It stops at the first operation to fail.
func (Dir) Exists ¶
Exists tests the existence of the given relative slash-separated path. The path is interpreted relative to dir.
func (Dir) FromSlash ¶
FromSlash resolves the given slash-separated path relative to dir. path must not be an absolute path.
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
An Operation describes a single step of a Dir.Apply. The zero value is a no-op.
func Mkdir ¶
Mkdir returns a new make directory operation. The name is a slash-separated path relative to the Dir.
func Remove ¶
Remove returns a new remove operation. The name is a slash-separated path relative to the Dir. Remove operations on directories are recursive.
func Rename ¶
Rename returns a new rename operation. old and new are slash-separated paths relative to the Dir.
func Symlink ¶
Symlink returns a new symlink operation. new is a slash-separated path relative to the Dir. old is a slash-separated path relative to new.