Documentation ¶
Index ¶
- func CheckFileType(path string) (file_type string, mime string)
- func CheckFileTypeByByte(b []byte) (file_type string, mime string)
- func CheckFileTypeByMultipart(file *multipart.FileHeader) (file_type string, mime string)
- func CreateFolder(folder string) error
- func DeCryptString(enc string) ([]byte, error)
- func DeleteFile(file_path string)
- func EnCryptToString(src string) string
- func FileSize(path string) int64
- func FormatFileSize(fileSize int64, unit string) string
- func FormatFileSizeToString(fileSize int64) (size string)
- func GetFileCachePathString(input_str string) (uri string, uri_md5 string, head_uri string)
- func GetFileMD5(file *multipart.FileHeader) (string, error)
- func GetFileMD5ByPath(filepath string) (string, error)
- func GetFilePathString() string
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsImage(path string) bool
- func ListDirFileNumber(folder string) int
- func ListDirSize(folder string)
- func PathExists(path string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFileType ¶
判断文件类型,返回文件类型字符串和MIME信息字符串
func CheckFileTypeByByte ¶
判断文件类型,返回文件类型字符串和MIME信息字符串
func CheckFileTypeByMultipart ¶
func CheckFileTypeByMultipart(file *multipart.FileHeader) (file_type string, mime string)
判断文件类型,返回文件类型字符串和MIME信息字符串
func FormatFileSize ¶
字节的单位转换,保留两位小数,将字节数转换为指定的单位(指定单位必须大写字母) B,KB,MB,GB,TB,EB
func FormatFileSizeToString ¶
字节的单位转换,保留两位小数,将字节数转换为带单位的字符串
func GetFileCachePathString ¶
生成文件对应的缓存目录相关字符串,专属函数
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.