utils

package
v0.0.0-...-9bc6933 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempFile

func CreateTempFile(dir, pattern string) (file *os.File, stat fs.FileInfo, effect func(), err error)

CreateTempFile usage:

f, stat, effect, err := CreateTempFile(dir, pattern)
if err != nil {
	//......
}
defer effect()

func GeneratePassword

func GeneratePassword(userPassword string) ([]byte, error)

GeneratePassword 给密码就行加密操作

func GetParamsInt64

func GetParamsInt64(c *gin.Context, key string) int64

func GetParamsStr

func GetParamsStr(c *gin.Context, key string) string

func ProtectRun

func ProtectRun(entry func())

保护方式允许一个函数

func RandomAlphaString

func RandomAlphaString(length int) string

RandomAlphaString 随机字母字符串

func RandomDigitString

func RandomDigitString(length int) string

RandomDigitString 随机数字字符串

func RandomLowerString

func RandomLowerString(length int) string

RandomLowerString 随机小写字符串

func RandomString

func RandomString(length int) string

RandomString 随机字符串

func RandomUpperString

func RandomUpperString(length int) string

RandomUpperString 随机大写字符串

func RetData

func RetData(c *gin.Context, data interface{})

func RetErr

func RetErr(c *gin.Context, err error)

func RetSuccess

func RetSuccess(c *gin.Context)

func Unpack

func Unpack(tarFile []byte) (files [][]byte, err error)

func ValidatePassword

func ValidatePassword(userPassword string, hashed string) (isOK bool, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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