Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPathNoDirectory = errors.New("invalid path, path needs a specific directory")
Functions ¶
func ValidateDirPath ¶
ValidateDirPath validates if the filepath is a diretory
Types ¶
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) 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.