Documentation ¶
Overview ¶
Package fs support facilitate for handler file and direction.
Index ¶
- Constants
- func AddEnvPath(paths ...string) string
- func Append(filename, text string) error
- func CheckDir(dir string) string
- func CheckFileDir(filename string) string
- func Copy(dstFile, srcFile string) (bool, error)
- func CopyDir(dst, src string)
- func DelEnvPath(paths ...string) string
- func EnvPath() []string
- func ExistPath(vPath string) bool
- func GetMemStatsRange() func() (runtime.MemStats, runtime.MemStats)
- func InsToFilename(filename, ins string) string
- func InsToFilenameDetect(filename, ins string) string
- func IsDir(dir string) bool
- func Put(filename, text string) error
- func RemoveList(files []string) string
- func StdDir(d string) string
- func StdPathList(paths ...string) []string
- func StdPathName(vPath string) string
- type ChildDirData
- type DirScanner
- type MemUsage
Constants ¶
const (
DirScannerChanMax = 5000
)
const (
VEnvPath = "path"
)
Variables ¶
This section is empty.
Functions ¶
func AddEnvPath ¶ added in v0.3.0
AddEnvPath and path to env
func CheckDir ¶ added in v0.2.1
CheckDir checkout if dir exist, when not exist will try to build it and return the path.
func CheckFileDir ¶ added in v1.4.0
CheckFileDir detect whether the parent directory where the file is located exists, and use it to automatically generate the parent directory when generating files (adaptable)
func DelEnvPath ¶ added in v0.3.0
DelEnvPath del the path from env path list.
func GetMemStatsRange ¶ added in v1.1.0
GetMemStatsRange get memory stats range callback
func InsToFilename ¶ added in v1.4.0
InsToFilename Insert the name after the file name and before the suffix,
E.G `$s => /test/pathx/name-eg.docx` into `/test/pathx/name-eg{$s}.docx`
func InsToFilenameDetect ¶ added in v1.4.0
InsToFilenameDetect tentatively obtaining the additional name of the inserted file
e.g.
`-custom => /test/pathx/name-eg.docx` into `/test/pathx/name-eg-custom.docx`
`custom.docx => /test/pathx/name-eg.docx` into `/test/pathx/custom.docx`
`/new/x/custom.docx => /test/pathx/name-eg.docx` into `/new/x/custom.docx`
func RemoveList ¶ added in v1.4.0
RemoveList batch remove File List
func StdPathList ¶ added in v1.5.0
StdPathList turn path list to standard path
func StdPathName ¶ added in v0.5.1
StdPathName the standard path format
Types ¶
type ChildDirData ¶ added in v1.1.0
type DirScanner ¶ added in v1.1.0
type DirScanner struct { AllItem int AllDirItem int AllFileItem int AllSize int64 TopChildDick map[string]ChildDirData Runtime time.Duration CddChanMax int // [Experimental] // contains filtered or unexported fields }
DirScanner the tool to scan the dirs.
func NewDirScanner ¶ added in v1.1.0
func NewDirScanner(vDir string) *DirScanner
func (*DirScanner) BaseDir ¶ added in v1.1.0
func (ds *DirScanner) BaseDir() string
func (*DirScanner) ChanNumber ¶ added in v1.1.0
func (ds *DirScanner) ChanNumber() int
func (*DirScanner) Exclude ¶ added in v1.1.0
func (ds *DirScanner) Exclude(excludes ...string) *DirScanner
Exclude exclude exp for dir scan
func (*DirScanner) Include ¶ added in v1.1.0
func (ds *DirScanner) Include(includes ...string) *DirScanner
Include exclude exp for dir scan
func (*DirScanner) Scan ¶ added in v1.1.0
func (ds *DirScanner) Scan() error
Scan to star scan the dir.
func (*DirScanner) ScanParallel ¶ added in v1.1.0
func (ds *DirScanner) ScanParallel() error
ScanParallel to star scan the dir.[Experimental]