folder

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentExecPath

func GetCurrentExecPath() (string, error)

GetCurrentExecPath get exec path

func GetCurrentFilePath

func GetCurrentFilePath() (string, error)

GetCurrentFilePath run path

func Mkdir

func Mkdir(path string) error

Mkdir will use FileMode 0766

func Path2WebPath added in v1.5.0

func Path2WebPath(path string) string

Path2WebPath local path to web path will move prefix filepath.Separator

func PathExists

func PathExists(path string) (bool, error)

PathExists path exists

func PathExistsFast

func PathExistsFast(path string) bool

PathExistsFast path exists fast

func PathFileList

func PathFileList(path string) []string

PathFileList list of Path file

func PathFolderList

func PathFolderList(path string) []string

PathFolderList list of Path Folder

func PathIsDir

func PathIsDir(path string) bool

PathIsDir exists path is dir or false

func PathIsFile

func PathIsFile(path string) bool

PathIsFile exists path is file or false

func PathJoin

func PathJoin(elem ...string) string

PathJoin is filepath.Join()

func PathParent

func PathParent(path string) string

PathParent as filepath.Dir

func ReadFileAsByte

func ReadFileAsByte(path string) ([]byte, error)

ReadFileAsByte read file as byte array

func ReadFileAsJson

func ReadFileAsJson(path string, v interface{}) error

ReadFileAsJson read file as json

func RmDir

func RmDir(path string, force bool) error

RmDir remove dir by path

func RmDirForce

func RmDirForce(path string) error

RmDirForce remove dir force

func WalkAllByGlob

func WalkAllByGlob(path string, glob string, ignoreFolder bool) ([]string, error)

WalkAllByGlob can walk all path then return as list, by glob with filepath.Glob

func WalkAllByMatchPath

func WalkAllByMatchPath(path string, pattern string, ignoreFolder bool) ([]string, error)

WalkAllByMatchPath can walk all path then return as list, by under path pattern

func WalkAllFileBySuffix

func WalkAllFileBySuffix(path string, suffix string) ([]string, error)

WalkAllFileBySuffix can walk all file then return all files as list, by file suffix

func WriteFileAsJson

func WriteFileAsJson(path string, v interface{}, fileMod fs.FileMode, coverage, beauty bool) error

WriteFileAsJson write json file path most use Abs Path v data fileMod os.FileMode(0666) or os.FileMode(0644) coverage true will coverage old beauty will format json when write

func WriteFileAsJsonBeauty

func WriteFileAsJsonBeauty(path string, v interface{}, coverage bool) error

WriteFileAsJsonBeauty write json file as 0666 and beauty

func WriteFileByByte

func WriteFileByByte(path string, data []byte, fileMod fs.FileMode, coverage bool) error

WriteFileByByte write bytes to file path most use Abs Path data []byte fileMod os.FileMode(0666) or os.FileMode(0644) coverage true will coverage old

Types

This section is empty.

Jump to

Keyboard shortcuts

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