Documentation ¶
Index ¶
- Variables
- func Abs(path string) (absolute string, err error)
- func Base(path string) (name string)
- func ChmodAll(src string)
- func CleanWithSlash(path string) (clean string)
- func CleanWithSlashes(path string) (clean string)
- func CopyFile(src, dst string) (int64, error)
- func Dir(path string) (name string)
- func Exists(path string) bool
- func Ext(path string) (extn string)
- func ExtExt(path string) (extn, extra string)
- func FindAllDirs(path string, includeHidden bool) (dirs []string, err error)
- func FindAllFiles(path string, includeHidden bool) (files []string, err error)
- func FindFileRelativeToPath(name, path string) (file string)
- func FindFileRelativeToPwd(name string) (file string)
- func GetSectionSlug(url string) (path, section, slug string)
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsHiddenPath(path string) (hidden bool)
- func Join(parts ...string) (joined string)
- func JoinWithSlash(paths ...string) (joined string)
- func JoinWithSlashes(paths ...string) (joined string)
- func List(path string) (paths []string, err error)
- func ListAllDirs(path string) (paths []string, err error)
- func ListAllFiles(path string) (paths []string, err error)
- func ListDirs(path string) (paths []string, err error)
- func ListFiles(path string) (paths []string, err error)
- func Mime(path string) (mime string, err error)
- func MimeFromPathOnly(path string) (mime string)
- func Mkdir(path string) (err error)
- func PruneEmptyDirs(path string) (err error)
- func Pwd() (path string)
- func ReadDir(path string) (paths []fs.DirEntry, err error)
- func ReadFile(path string) (content []byte, err error)
- func SafeConcatRelPath(root string, paths ...string) (out string)
- func SafeConcatUrlPath(root string, paths ...string) (out string)
- func Stat(path string) (spec times.Timespec, err error)
- func ToSlug(path string) (slug string)
- func TrimDotSlash(path string) (out string)
- func TrimExt(path string) (out string)
- func TrimPrefix(path, prefix string) (modified string)
- func TrimRelativeToRoot(path, root string) (rel string)
- func TrimSlash(path string) (clean string)
- func TrimSlashes(path string) (clean string)
- func TrimTrailingSlash(path string) (out string)
- func Walk(root string, fn filepath.WalkFunc) (err error)
- func Which(name string) (path string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RxDupeSlashes = regexp.MustCompile(`/+`) RxBothSlashes = regexp.MustCompile(`^\s*/?(.+?)/?\s*$`) RxSlashDotSlash = regexp.MustCompile(`/\./`) )
View Source
var (
ErrorDirNotFound = fmt.Errorf(`not found or not an existing directory`)
)
Functions ¶
func CleanWithSlash ¶
func CleanWithSlashes ¶
func ExtExt ¶
ExtExt returns the extension of the file (without the dot) and any secondary extension found in the path
func FindFileRelativeToPath ¶
func FindFileRelativeToPwd ¶
func GetSectionSlug ¶
func IsHiddenPath ¶
func JoinWithSlash ¶
func JoinWithSlashes ¶
func List ¶
List returns a list of directories and files, sorted in natural order with directories grouped before files
func ListAllDirs ¶
func ListAllFiles ¶
func MimeFromPathOnly ¶
func PruneEmptyDirs ¶
func SafeConcatRelPath ¶
func SafeConcatUrlPath ¶
func TrimDotSlash ¶
func TrimPrefix ¶
func TrimRelativeToRoot ¶
func TrimSlashes ¶
func TrimTrailingSlash ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.