utils

package
v0.0.0-...-bf11d8c Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileIsImage

func CheckFileIsImage(suffix string) string

CheckFileIsImage 校验文件是否是图片

func CheckFileSizeIsRight

func CheckFileSizeIsRight(fileSize float64) bool

CheckFileSizeIsRight 检验上传文件大小是否符合配置

func CheckFileSuffixIsRight

func CheckFileSuffixIsRight(file *multipart.FileHeader) (suffix string, err error)

CheckFileSuffixIsRight 校验文件后缀是否符合配置

func GenerateRandomCode

func GenerateRandomCode(len int8) string

GenerateRandomCode 随机生成 len 位验证码

func GenerationFilePath

func GenerationFilePath(fileName string) string

func GetUserRealIP

func GetUserRealIP(c *gin.Context) string

GetUserRealIP 获取用户真实IP地址

func GetValidMsg

func GetValidMsg(err error, obj any) string

GetValidMsg 返回结构体中的msg参数 (使用gin校验器时 取出tag中定义的msg)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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