Documentation ¶
Index ¶
- Variables
- func CopyDir(source string, dest string, ...) (err error)
- func CopyFile(source string, dest string) (err error)
- func DirExist(path string) bool
- func FileExist(path string) bool
- func FileSize(file string) (size string)
- func FileSizeUint(file string) (size uint64)
- func GetMimeType(filename string, content []byte) (ctype string)
- func GzCompress(currentPath, dest string) (err error)
- func GzDeCompress(tarFile, dest string) error
- func IsSubPath(subPath, path string) bool
- func ParseJson(data interface{}, filePath string) error
- func PathExist(path string) (int, error)
- func ProgramPath(addSlash ...bool) (path string)
- func PutAppend(path string, b []byte) (err error)
- func PutOffset(path string, b []byte, offset int64) (err error)
- func ReadFile(path string) ([]byte, error)
- func ReadLineFile(path string, handle func(line int, data []byte) error) (err error)
- func RealPath(path string, addSlash ...bool) (realPath string)
- func RealPathMkdir(path string, addSlash ...bool) string
- func Remove(path string) error
- func Rmdir(path string, notIncludeSelf ...bool) (ok bool)
- func RootPath() string
- func SafePath(path string, pathRange ...string) string
- func SaveJson(data interface{}, filename string) error
- func SizeFormat(s uint64) string
- func TmpPath(pattern ...string) string
- func WriteFile(path string, b []byte, isAppend ...bool) (err error)
- func ZipCompress(currentPath, dest string) (err error)
- func ZipDeCompress(zipFile, dest string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ProjectPath = "./"
)
Functions ¶
func CopyDir ¶
func CopyDir(source string, dest string, filterFn ...func(srcFilePath, destFilePath string) bool) (err error)
CopyDir copies the source directory to the dest directory.
func GetMimeType ¶
GetMimeType get file mime type
func GzCompress ¶
GzCompress use gzip to compress to tar.gz
func PathExist ¶
PathExist PathExist 1 exists and is a directory path, 2 exists and is a file path, 0 does not exist
func ProgramPath ¶
ProgramPath program directory path
func ReadLineFile ¶
ReadLineFile ReadLineFile
func RealPathMkdir ¶
RealPathMkdir get an absolute path, create it if it doesn't exist
func ZipDeCompress ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.