helper

package
v0.0.0-...-a253b9f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteFormat

func ByteFormat(b int64) string

ByteFormat 将字节为单位的大小转换为易读的字符串格式

func Copy

func Copy(src, dst string) (written int64, err error)

Copy 拷贝文件

func FileMd5

func FileMd5(path string) (string, error)

FileMd5 计算文件的MD5

func FileSha256

func FileSha256(path string) (string, error)

FileSha256 计算文件的SHA256

func GetSymlinkTarget

func GetSymlinkTarget(path string) (string, error)

GetSymlinkTarget 获取符号链接指向的目标

func HideSecret

func HideSecret(secret string, count uint32) string

HideSecret 隐藏字符串的中间字符

func IsDir

func IsDir(path string) (bool, error)

IsDir 判断路径是否文件夹

func IsDirEmpty

func IsDirEmpty(dirPath string) (bool, error)

IsDirEmpty 判断文件夹是否为空

func IsExist

func IsExist(path string) (bool, error)

IsExist 判断路径是否存在

func IsIgnore

func IsIgnore(path string, ignoreList []string) bool

IsIgnore 判断路径或文件是否在忽略配置中

func IsSymlink(path string) (bool, error)

IsSymlink 判断路径是否符号链接

func RandomString

func RandomString(length int) (string, error)

RandomString 生成指定长度的随机字符串

func StringMd5

func StringMd5(str string) string

StringMd5 计算字符串的MD5值

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL