Documentation
¶
Overview ¶
Package fs provides filesystem-related utilities.
Index ¶
- func BaseName(path string) string
- func Copy(src, dst string) error
- func FileExists(path string) bool
- func IsDir(path string) bool
- func LoadJSON(path string, data interface{}) error
- func LoadYAML(path string, data interface{}) error
- func MoveFile(src, dst string) (err error)
- func SanitizeName(name string) string
- func SaveJSON(path string, data interface{}, format bool) error
- func SaveYAML(path string, data interface{}) error
- func Split(path string) []string
- func TrimExtension(path string) string
- func UnsanitizeName(name string) string
- func Walk(fs http.FileSystem, root string, walkFn filepath.WalkFunc) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
FileExists returns true if the path points to a regular file.
func MoveFile ¶
MoveFile moves a file in the file system or across volumes, using rename if possible, but falling back to copying the file if not. This will error if either src or dst are not regular files.
func SanitizeName ¶
SanitizeName sanitizes a file name by replacing invalid characters.
func Split ¶
Split a path into its component parts. In the case of a full path, the first element will be filepath.Separator, possibly prefixed by a volume name. In the case of a relative path, the first element will be ".".
func TrimExtension ¶
TrimExtension trims any extension from the path.
func UnsanitizeName ¶
UnsanitizeName reverses the effects of a call to SanitizeName.
Types ¶
This section is empty.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package embedded provides an implementation of an embedded filesystem.
|
Package embedded provides an implementation of an embedded filesystem. |
htmltmpl
Package htmltmpl provides convenience utilities for using html templates in an embedded filesystem.
|
Package htmltmpl provides convenience utilities for using html templates in an embedded filesystem. |
texttmpl
Package texttmpl provides convenience utilities for using text templates in an embedded filesystem.
|
Package texttmpl provides convenience utilities for using text templates in an embedded filesystem. |
Package paths provides platform-specific standard paths.
|
Package paths provides platform-specific standard paths. |
Package safe provides safe, atomic saving of files.
|
Package safe provides safe, atomic saving of files. |
Package zip provides simple zip extraction.
|
Package zip provides simple zip extraction. |