pather

package
v1.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotDir  = errorer.Errorf("not a directory")
	ErrNotDirv = errorer.Errorfn(ErrNotDir)
)
View Source
var (
	ErrNotFile  = errorer.Errorf("not a file")
	ErrNotFilev = errorer.Errorfn(ErrNotDir)
)

Functions

func Base

func Base[T ~string](path T) string

func Dir

func Dir[T ~string](path T) string

func DirEnsure

func DirEnsure(path string) error

func DirEnsureWithConfig

func DirEnsureWithConfig(path string, config DirConfig) error

func GetDirs

func GetDirs(root string) ([]string, error)

func GetFiles

func GetFiles(root string) ([]string, error)

func GetPaths

func GetPaths(root string) ([]string, error)

func IsDir

func IsDir[T ~string](path T) (bool, error)

func IsFile

func IsFile[T ~string](path T) (bool, error)

func IsFileErr

func IsFileErr[T ~string](path T) error

func Join

func Join[T ~string](elems ...T) string

func PathExists

func PathExists(path string) bool

func PathExistsErr

func PathExistsErr(path string) (bool, error)

func WalkDirs

func WalkDirs(root string, filterFn func(string, fs.FileInfo) bool, processFn func(string, fs.FileInfo) error) error

func WalkFiles

func WalkFiles(root string, filterFn func(string, fs.FileInfo) bool, processFn func(string, fs.FileInfo) error) error

func WalkPaths

func WalkPaths(root string, filterFn func(string, fs.FileInfo) bool, processFn func(string, fs.FileInfo) error) error

Types

type DirConfig

type DirConfig struct {
	Perm  os.FileMode
	Owner string
	Group string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL