Documentation ¶
Index ¶
- func Abs(path string) (string, error)
- func Basename(path string) string
- func CleanPath(p string) string
- func CopyFile(srcPath string, dstPath string) error
- func CurrentPath() string
- func Dirname(path string) string
- func ExecPath() string
- func Exist(path string) bool
- func FileMode(path string) (fs.FileMode, error)
- func FileSize(path string) int64
- func FilenameNoExt(filename string) string
- func Format(path string) string
- func GenUniqueFilename(filename string, tries int, callback func(name string) string) (string, error)
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsLink(path string) bool
- func IsZipFile(filepath string) bool
- func Join(elem ...string) string
- func ListFiles(path string) ([]string, error)
- func MTime(filepath string) (int64, error)
- func MiMeType(file any) string
- func Mkdir(path string) error
- func MkdirP(path string) error
- func Move(src, dst string) error
- func Pwd() string
- func ReadByLine(path string) ([]string, error)
- func ReadCsvFile(filepath string) ([][]string, error)
- func ReadToString(path string) (string, error)
- func Relvate(basepath, targpath string) (string, error)
- func Rm(path string) error
- func Rmf(path string) error
- func Sha(filepath string, shaType ...int) (string, error)
- func Split(path string) (string, string)
- func Suffix(path string) string
- func UnZip(zipFile string, destPath string) error
- func WriteBytesToFile(filepath string, content []byte) error
- func WriteCsvFile(filepath string, records [][]string, append bool) error
- func WriteStringToFile(filepath string, content string, append bool) error
- func Zip(fpath string, destPath string) error
- func ZipAppendEntry(fpath string, destPath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilenameNoExt ¶
FilenameNoExt get the filename without subfix
func GenUniqueFilename ¶
func GenUniqueFilename(filename string, tries int, callback func(name string) string) (string, error)
GenUniqueFilename gen a unique filename
func MiMeType ¶
MiMeType return file mime type param `file` should be string(file path) or *os.File.
func ReadCsvFile ¶
ReadCsvFile read file content into slice.
func ReadToString ¶
ReadToString return string of file content.
func WriteBytesToFile ¶
WriteBytesToFile write bytes to target file.
func WriteCsvFile ¶
WriteCsvFile write content to target csv file.
func WriteStringToFile ¶
WriteStringToFile write string to target file.
func ZipAppendEntry ¶
ZipAppendEntry append a single file or directory by fpath to an existing zip file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.