Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPathNoDirectory = errors.New("invalid path, path needs a specific directory")
Functions ¶
func FileExists ¶ added in v0.0.3
fileExists returns true if a file at path already exists; false otherwise.
func IsDir ¶ added in v0.0.3
IsDir returns true if path represents a directory in the fileSystem otherwise false is returned
func NormalizeDir ¶ added in v0.0.3
NormalizeDir returns full absolute directory path of the passed directory or an error. This function cleans up paths such as current directory (.), relative directories (..), or multiple separators.
Types ¶
type Directory ¶ added in v0.0.3
type Directory struct {
Path string
}
Directory creates a new temp directory, in which files get created.
func CreateTempDirectory ¶ added in v0.0.3
CreateDirectory does create the actual disk directory, and return a new representation of it.
type FS ¶
type FS interface { Open(path string) (fs.File, error) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error) Create(path string) (*os.File, error) // Readfile returns the content of a given file ReadFile(path string) ([]byte, error) // WriteFile writes the data to a file at the given path, // it overwrites existing content WriteFile(path string, data []byte, perm fs.FileMode) error // Calculate a sha256 cheksum on the file Sha256(path string) (string, error) // Walk walks the file system with the given WalkDirFunc. Walk(path string, walkFn fs.WalkDirFunc) error // Exists is true if the path exists in the file system. Exists(path string) bool // Stat returns a FileInfo describing the named file from the file system. Stat(path string) (fs.FileInfo, error) // Glob returns the list of matching files, // emulating https://golang.org/pkg/path/filepath/#Glob Glob(pattern string) ([]string, error) // MkDir makes a directory. Mkdir(path string) error // MkDirAll makes a directory path, creating intervening directories. MkdirAll(path string) error // RemoveAll removes path and any children it contains. RemoveAll(path string) error // RemoveAll removes path and any children it contains. Remove(path string) error }
Click to show internal directories.
Click to hide internal directories.