Documentation
¶
Index ¶
- Constants
- func ByteFmt(size int64) string
- func CheckDuplicateAndRename(path string) (string, error)
- func CreateDirIfNotExist(dir string) error
- func Dir(path string) string
- func Filepath(path string, originName string, customName string) string
- func GetSingleDir(paths []string) string
- func IsExistsFile(path string) bool
- func MapToStruct(s any, v any) error
- func ParseDataUri(uri string) (string, []byte)
- func ParseSchema(url string) string
- func SafeRemove(name string) error
- type Timer
Constants ¶
View Source
const FileSchema = "FILE"
Variables ¶
This section is empty.
Functions ¶
func CheckDuplicateAndRename ¶
CheckDuplicateAndRename rename duplicate file, add suffix (1) (2) ... if file name is a.txt, rename to a (1).txt if directory name is a, rename to a (1) return new name
func CreateDirIfNotExist ¶ added in v1.3.5
func GetSingleDir ¶
GetSingleDir get the top level single folder name,if not exist, return empty string
func IsExistsFile ¶ added in v1.3.8
IsExistsFile check file exists and is a file
func MapToStruct ¶
func ParseDataUri ¶ added in v1.3.8
ParseDataUri parses a data URI and returns the MIME type and decode data.
func ParseSchema ¶
func SafeRemove ¶
SafeRemove remove file safely, ignoring errors if the path does not exist.
Types ¶
Click to show internal directories.
Click to hide internal directories.