utilx

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoLoad

func AutoLoad(ptr any, re string, ps ...any)

AutoLoad 自动加载

func ComparePasswords

func ComparePasswords(hashedPwd string, plainPwd []byte) bool

ComparePasswords 验证密码

func CopyFile

func CopyFile(src, dest string, force bool) error

CopyFile 拷贝文件

func CreateDir

func CreateDir(dir string) error

CreateDir 创建单个目录

func CreateFile

func CreateFile(path string, content []byte) error

CreateFile 创建文件

func CreateMutiDir

func CreateMutiDir(path string) error

CreateMutiDir 创建多级目录

func FsIsExist

func FsIsExist(fs string) bool

FsIsExist 判断目录/文件是否存在

func FsList

func FsList(filePath string, hasDir bool) ([]string, error)

FsList 列举目录中的对象

func FsRemove

func FsRemove(path string, force bool) error

FsRemove 删除目录/文件

func GenerateRandomID

func GenerateRandomID() string

GenerateRandomID 生成字符串ID

func GenerateUUID

func GenerateUUID() string

GenerateUUID 生成全局唯一UUID

func HashAndSaltPassword

func HashAndSaltPassword(pwd []byte) (string, error)

HashAndSaltPassword 密码加密

func LoadComponents

func LoadComponents(component any)

LoadComponent 自动加载组件

func LoadRouters

func LoadRouters(router any, group *gin.RouterGroup)

LoadRouter 自动加载路由

func Md5

func Md5(src string) string

Md5 md5加密

func MoveFile

func MoveFile(srcFile, destFile string) error

MoveFile 移动文件

func ReadFileToString

func ReadFileToString(filePath string) (string, error)

ReadFile 读取文件内容

Types

This section is empty.

Jump to

Keyboard shortcuts

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