Documentation ¶
Index ¶
- func ComputeFileSHA256(filePath string) (string, error)
- func CreateDir(dirPath string) error
- func CreateDirIfNotExist(relativePath string) error
- func Delete(path string) error
- func DetectFileType(file io.Reader) (string, error)
- func GetAllFilesByExt(dir string, ext string) ([]string, error)
- func GetCurExeDir() string
- func GetFileCreationTime(filePath string) (string, time.Time, error)
- func GetFileMd5(filePath string) (string, error)
- func GetFileMd5Stream(filePath string) (string, error)
- func GetFileNameMd5(filename string) (string, error)
- func IsDirAndHasFiles(dirPath string) (bool, bool, error)
- func IsFile(path string) (bool, error)
- func StartsWithDot(fileName string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeFileSHA256 ¶
ComputeFileSHA256 计算文件的SHA-256哈希
func CreateDirIfNotExist ¶
CreateDirIfNotExist 在当前执行文件所在目录下创建指定的目录,如果目录不存在
func DetectFileType ¶ added in v1.8.35
DetectFileType 读取文件的前 512 个字节并检测文件的 MIME 类型
func GetAllFilesByExt ¶
GetAllFilesByExt 根据文件扩展名获取所有文件
func GetFileCreationTime ¶
GetFileCreationTime 获取文件创建时间
func GetFileMd5Stream ¶
GetBigFileMd5 通过流的方式计算文件的 MD5 值
func GetFileNameMd5 ¶
GetFileNameMd5 计算文件名的 MD5 值
func IsDirAndHasFiles ¶
IsDirAndHasFiles 检查目录是否存在并且包含文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.