utils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertModel

func ConvertModel(src, dst interface{})

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 IsExist

func IsExist(path string) bool

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

func Md5Str

func Md5Str(str string) string

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

Types

type FormatMap

type FormatMap map[string]interface{}

Jump to

Keyboard shortcuts

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