utils

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertModel

func ConvertModel(src, dst any)
func CreateLink(src, dst string) error

func CreateMutiDir

func CreateMutiDir(filePath string) error

CreateMutiDir 调用os.MkdirAll递归创建文件夹

func Filename

func Filename(filename string) string

func Format

func Format(format string, p FormatMap) string

func IsDir added in v0.4.1

func IsDir(path string) bool

IsDir 判断所给路径是否为文件夹

func IsExist

func IsExist(path string) bool

IsExist 判断所给路径文件/文件夹是否存在(返回true是存在)

func Md5Str

func Md5Str(str string) string

func Rename added in v0.5.0

func Rename(src, dst string) error

func Sha256

func Sha256(src string) string

func Sleep

func Sleep(second int, ctx context.Context) bool

Sleep

@Description: 信号计时器,每秒检测一次信号,避免长时间等待无法接收信号
@Description: 收到exit信号后,会返回true;倒计时结束,会返回false
@param second int
@param exit chan bool
@return bool

func UTCToTimeStr added in v0.4.3

func UTCToTimeStr(t1 string) string

Types

type FormatMap

type FormatMap map[string]any

Jump to

Keyboard shortcuts

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