utils

package
v0.0.0-...-711136c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPhoneIsValid

func CheckPhoneIsValid(fl validator.FieldLevel) bool

判断手机号是否有效

func CheckPwdIsValid

func CheckPwdIsValid(hashedPwd string, originPwd string) error

func CreateMinioBucket

func CreateMinioBucket(client *minio.Client, bucketName string) error

func EncryptionPassword

func EncryptionPassword(originPwd string) (string, error)

func FormatTime

func FormatTime(pTime time.Time) string

func FormatTimeMilliSec

func FormatTimeMilliSec(pTime time.Time) string

func FormatTimeNormal

func FormatTimeNormal(pTime time.Time) string

func GenRandToken

func GenRandToken() string

生成num*2位的字符串

func GenValidateCode

func GenValidateCode(width int) string

生成短信验证码

func GetContentType

func GetContentType(fileName string) (contentType string)

func GoTime2ProtoTime

func GoTime2ProtoTime(goTime time.Time) *timestamp.Timestamp

func HttpResponse

func HttpResponse(ctx *gin.Context, status int, data interface{}, msg string)

func NewStringPoint

func NewStringPoint(val string) *string

func NewUint64Point

func NewUint64Point(val uint64) *uint64

func ProtoTime2GoTime

func ProtoTime2GoTime(protoTime *timestamp.Timestamp) time.Time

func UploadToMinio

func UploadToMinio(client *minio.Client, bucketName string, fileName string, contentType string, f io.Reader, size int64) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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